diff options
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index 305caf1cb5..faa74d6c9d 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -46,11 +46,12 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { private static final String HOSTNAME_PROPERTY = "com.vaadin.testbench.deployment.hostname"; private static final String PORT_PROPERTY = "com.vaadin.testbench.deployment.port"; private static final Properties properties = new Properties(); + private static final File propertiesFile = new File("work", + "eclipse-run-selected-test.properties"); static { - File file = new File("work", "eclipse-run-selected-test.properties"); - if (file.exists()) { + if (propertiesFile.exists()) { try { - properties.load(new FileInputStream(file)); + properties.load(new FileInputStream(propertiesFile)); } catch (IOException e) { throw new RuntimeException(e); } @@ -180,8 +181,21 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { driver = new FirefoxDriver(); } } else if (BrowserUtil.isChrome(desiredCapabilities)) { - System.setProperty("webdriver.chrome.driver", - getProperty("chrome.driver.path")); + String propertyName = "chrome.driver.path"; + String chromeDriverPath = getProperty(propertyName); + if (chromeDriverPath == null) { + throw new RuntimeException( + "You need to install ChromeDriver to use @" + + RunLocally.class.getSimpleName() + + " with Chrome." + + "\nFirst install it from https://code.google.com/p/selenium/wiki/ChromeDriver." + + "\nThen update " + + propertiesFile.getAbsolutePath() + + " to define a property named " + + propertyName + + " containing the path of your local ChromeDriver installation."); + } + System.setProperty("webdriver.chrome.driver", chromeDriverPath); driver = new ChromeDriver(); } else if (BrowserUtil.isSafari(desiredCapabilities)) { driver = new SafariDriver(); |