use of com.jprotractor.NgWebDriver in project selenium_java by sergueik.
the class ProtractorDriver method init.
@Before
public void init() throws MalformedURLException {
log.info("Launching (protractor) in " + browser + "...");
DesiredCapabilities capabilities = null;
if (browser.toLowerCase().equals("firefox")) {
capabilities = capabilitiesFirefox(capabilities);
} else if (browser.toLowerCase().equals("phantomjs")) {
capabilities = capabilitiesPhantomJS(capabilities);
} else if (browser.toLowerCase().equals("chrome")) {
capabilities = capabilitiesChrome(capabilities);
} else if (browser.toLowerCase().equals("iexplore")) {
capabilities = capabilitiesExplorer(capabilities);
} else if (browser.toLowerCase().equals("android")) {
capabilities = capabilitiesAndroid(capabilities);
} else if (browser.toLowerCase().equals("iphone")) {
capabilities = capabilitiesiPhone(capabilities);
} else if (browser.toLowerCase().equals("ipad")) {
capabilities = capabilitiesiPad(capabilities);
}
if (!location.toLowerCase().contains("local")) {
log.info("Running on Selenium Grid: " + location);
driver = new RemoteWebDriver(new URL(location), capabilities);
} else if (browser.toLowerCase().equals("firefox")) {
driver = new FirefoxDriver(capabilities);
} else if (browser.toLowerCase().equals("phantomjs")) {
driver = new PhantomJSDriver(capabilities);
} else if (browser.toLowerCase().equals("chrome")) {
driver = new ChromeDriver(capabilities);
} else if (browser.toLowerCase().equals("iexplore")) {
driver = new InternetExplorerDriver(capabilities);
} else if (browser.toLowerCase().equals("android")) {
driver = new ChromeDriver(capabilities);
} else if (browser.toLowerCase().equals("iphone")) {
driver = new ChromeDriver(capabilities);
} else if (browser.toLowerCase().equals("ipad")) {
driver = new ChromeDriver(capabilities);
}
ngDriver = new NgWebDriver(driver);
wait = new WebDriverWait(driver, flexibleWait);
wait.pollingEvery(pollingInterval, TimeUnit.MILLISECONDS);
actions = new Actions(driver);
}
Aggregations