if(seleniumServer.equals("localhost") || seleniumServer.equals("hub")) { // hub means inside Box but not using the grid
StandaloneConfiguration sc = new StandaloneConfiguration();
if (null != port && ""!=port)
sc.port = Integer.parseInt(port);
try {
server = new SeleniumServer(sc);
server.boot();
} catch (Exception e) {
throw new IllegalStateException("Can't start selenium server", e);
}
} else {
localExecution = false;
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8c7c89b3-8546-4e53-a39b-996f71cef58e%40googlegroups.com.
protected static WebDriver driverInstance[] = new WebDriver[MAX_DRIVERS+1];
public void beforeSuite(ITestContext context)
{
....
String seleniumServer = AutomationUtility.getProperty("uitest.selenium.host", "localhost");
String port = AutomationUtility.getProperty("uitest.selenium.port","4444");
if(seleniumServer.equals("localhost") || seleniumServer.equals("hub")) { // hub means inside qaBox but not using the grid
StandaloneConfiguration sc = new StandaloneConfiguration();
if (null != port && ""!=port)
sc.port = Integer.parseInt(port);
try {
server = new SeleniumServer(sc);
server.boot();
} catch (Exception e) {
throw new IllegalStateException("Can't start selenium server", e);
}
} else {
localExecution = false;
}
}
public void setupDriver(String browser, int num)
{
... Get all browser info - type, host, port, grid user, grid token, etc.
WebDriverManager wdm = null;
// Example for Chrome
if(seleniumBrowser.equals("*chrome"))
{
options = new ChromeOptions();
Logger.detailsFine("Starting chrome driver");
... Add chrome options
Reporter.getCurrentTestResult().setAttribute("browser", "Chrome");
String chromeWebdriver = AutomationUtility.getProperty("uitest.chrome.webdriver", "webdriver.chrome.driver");
String chromeWebdriverLocation = AutomationUtility.getProperty("uitest.chrome.webdriverLocation", "lib\\chromedriver.exe");
System.setProperty(chromeWebdriver, chromeWebdriverLocation);
if(localExecution)
wdm = WebDriverManager.chromedriver();
}
}
... other browsers
if(wdm != null && localExecution)
wdm.setup();
driverInstance[num] = new RemoteWebDriver(new URL("http://"+seleniumHost+":"+seleniumPort+"/wd/hub"), options);
... other browser-specific code
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6b92170b-a2fa-49f1-9f37-22f437828e87%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6b92170b-a2fa-49f1-9f37-22f437828e87%40googlegroups.com.