use of org.openqa.selenium.chrome.ChromeDriver in project jmeter-plugins by undera.
the class ChromeDriverConfigTest method shouldNotCreateChromeWhenStartingServiceThrowsAnException.
@Test
public void shouldNotCreateChromeWhenStartingServiceThrowsAnException() throws Exception {
ChromeDriverService.Builder mockServiceBuilder = mock(ChromeDriverService.Builder.class);
whenNew(ChromeDriverService.Builder.class).withNoArguments().thenReturn(mockServiceBuilder);
when(mockServiceBuilder.usingDriverExecutable(isA(File.class))).thenReturn(mockServiceBuilder);
ChromeDriverService mockService = mock(ChromeDriverService.class);
when(mockServiceBuilder.build()).thenReturn(mockService);
doThrow(new IOException("Stubbed exception")).when(mockService).start();
final ChromeDriver browser = config.createBrowser();
assertThat(browser, is(nullValue()));
assertThat(config.getServices(), is(Collections.<String, ChromeDriverService>emptyMap()));
verify(mockServiceBuilder, times(1)).build();
}
use of org.openqa.selenium.chrome.ChromeDriver in project divolte-collector by divolte.
the class SeleniumTestBase method setupLocalChrome.
private void setupLocalChrome() {
System.setProperty("webdriver.chrome.driver", Optional.ofNullable(System.getenv(CHROME_DRIVER_LOCATION_ENV_VAR)).orElseThrow(() -> new RuntimeException("When using 'chrome' as Selenium driver, please set the location of the " + "Chrome driver manager server thingie in the env var: " + CHROME_DRIVER_LOCATION_ENV_VAR)));
driver = new ChromeDriver();
}
use of org.openqa.selenium.chrome.ChromeDriver in project trainning by fernandotomasio.
the class DriverFactory method getDriver.
public static WebDriver getDriver() {
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://localhost:8080/trainning-webapp");
driver.findElement(By.name("j_username")).sendKeys("fernandofot");
driver.findElement(By.name("j_password")).sendKeys("roland");
driver.findElement(By.name("j_username")).submit();
return driver;
}
use of org.openqa.selenium.chrome.ChromeDriver in project java-client by appium.
the class DesktopBrowserCompatibilityTest method chromeTest.
@Test
public void chromeTest() {
WebDriver driver = new ChromeDriver();
try {
PageFactory.initElements(new AppiumFieldDecorator(driver, 15, TimeUnit.SECONDS), this);
driver.get(new File("src/test/java/io/appium/java_client/hello appium - saved page.htm").toURI().toString());
assertNotEquals(0, foundLinks.size());
assertNotEquals(0, main.size());
assertEquals(null, trap1);
assertEquals(null, trap2);
} finally {
driver.quit();
}
}
use of org.openqa.selenium.chrome.ChromeDriver in project java-client by appium.
the class TimeoutTest method setUp.
/**
* The setting up.
*/
@Before
public void setUp() {
setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, getChromeDriver().getAbsolutePath());
driver = new ChromeDriver();
timeOutDuration = new TimeOutDuration(DEFAULT_TIMEOUT, DEFAULT_TIMEUNIT);
initElements(new AppiumFieldDecorator(driver, timeOutDuration), this);
}
Aggregations