From 3d76bb0014b794a1c4864a0e71d3f5dc13e9b5f0 Mon Sep 17 00:00:00 2001 From: sephinroth Date: Tue, 29 Jan 2013 12:03:56 +0800 Subject: [PATCH] Add Mac/Linux support for chromedriver. --- src/com/netease/dagger/GlobalSettings.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/netease/dagger/GlobalSettings.java b/src/com/netease/dagger/GlobalSettings.java index b3e6ae2..5fb0010 100644 --- a/src/com/netease/dagger/GlobalSettings.java +++ b/src/com/netease/dagger/GlobalSettings.java @@ -25,7 +25,8 @@ public class GlobalSettings { public static int BrowserCoreType = Integer.parseInt(prop.getProperty("BrowserCoreType", "2")); - public static String ChromeDriverPath = prop.getProperty("ChromeDriverPath", "res/chromedriver_for_win.exe"); + public static String ChromeDriverPath = System.getProperties().getProperty("os.name").toLowerCase().contains("win") ? + prop.getProperty("ChromeDriverPath", "res/chromedriver_for_win.exe") : prop.getProperty("ChromeDriverPath", "res/chromedriver_for_mac"); public static String IEDriverPath = prop.getProperty("IEDriverPath", "res/iedriver_32.exe");