Bug 4339: fixed a potential failure due to webdriver implementations

that do not support maximizing the browser window
This commit is contained in:
Steffen Schaefer committed 2018-07-23 11:22:03 +02:00
1 parent d09b3899e5
commit 45ad7b5e7e
1 file changed
+6 -1
@@ -176,7 +176,12 @@ public class SeleniumRunner extends ParentRunner<SeleniumJUnit4ClassRunner> {
DesiredCapabilities capabilities = new DesiredCapabilities(capabilityDefinitions);
Constructor<WebDriver> constructor = clazz.getConstructor(Capabilities.class);
WebDriver driver = constructor.newInstance(capabilities);
driver.manage().window().maximize();
try {
driver.manage().window().maximize();
} catch (Exception e) {
// Depending on the combination of OS and WebDriver implementation this may fail
// e.g. chrome with xvfb can't do this successfully.
}
File screenshots = resolveScreenshotFolder();