How do i take a screenshot of parallel running web drivers tests ? I can't define webdriver as static when I'm running parallel. Every test will have it's own instance how will I know which test failed? any suggestionsmy code goes like this--public class WebDriverTest {
public WebDriver webDriver;
public void setUpProperties(String seleniumHostAddress, int seleniumPort,
String browser, String appHost, String dbDriver,
String url, String userName, String password, String busDbUrl, String busUserName,
String busPassword)
throws Exception {
DesiredCapabilities desiredCapabilities = null;
if (browser.equalsIgnoreCase("*firefox")) {
desiredCapabilities = DesiredCapabilities.firefox();
}
else if (browser.equalsIgnoreCase("*chrome")) {
desiredCapabilities = DesiredCapabilities.chrome();
}
else if (browser.equalsIgnoreCase("*iexplore")) {
desiredCapabilities = DesiredCapabilities.internetExplorer();
}
stdout.print("http://" + seleniumHostAddress + ":" + seleniumPort + "/srm");
webDriver = new RemoteWebDriver(new URL("http://" + seleniumHostAddress + ":" + seleniumPort + "/wd/hub"), desiredCapabilities);
webDriver.get(appHost);
webDriver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);
}
}
Thanks
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/CbNZfkuPXa0J.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
I updated my Selenium maven template today to use TestNG (as it seems to be what all the cool kids are using) and added in a screenshot listener that will take a screenshot if the test fails.
It’s also on its way to being configured to use multiple threading at method level:
https://github.com/Ardesco/Selenium-Maven-Template
enjoy J
--