use of org.openqa.selenium.chrome.ChromeDriver in project selenium_java by sergueik.
the class WebRtcChromeTest method setupTest.
@Before
public void setupTest() {
ChromeOptions options = new ChromeOptions();
// This flag avoids to grant the user media
options.addArguments("--use-fake-ui-for-media-stream");
// This flag fakes user media with synthetic video (green with spinner
// and timer)
options.addArguments("--use-fake-device-for-media-stream");
driver = new ChromeDriver(options);
}
use of org.openqa.selenium.chrome.ChromeDriver in project webmagic by code4craft.
the class SeleniumTest method testSelenium.
@Ignore("need chrome driver")
@Test
public void testSelenium() {
System.getProperties().setProperty("webdriver.chrome.driver", "/Users/yihua/Downloads/chromedriver");
Map<String, Object> contentSettings = new HashMap<String, Object>();
contentSettings.put("images", 2);
Map<String, Object> preferences = new HashMap<String, Object>();
preferences.put("profile.default_content_settings", contentSettings);
DesiredCapabilities caps = DesiredCapabilities.chrome();
caps.setCapability("chrome.prefs", preferences);
caps.setCapability("chrome.switches", Arrays.asList("--user-data-dir=/Users/yihua/temp/chrome"));
WebDriver webDriver = new ChromeDriver(caps);
webDriver.get("http://huaban.com/");
WebElement webElement = webDriver.findElement(By.xpath("/html"));
System.out.println(webElement.getAttribute("outerHTML"));
webDriver.close();
}
use of org.openqa.selenium.chrome.ChromeDriver in project software-quality by Mur3ph.
the class BrowserDriver method instantiateChromeBrowserDriver.
private void instantiateChromeBrowserDriver() {
LOGGER.info("++instantiateChromeBrowserDriver()");
driver = new ChromeDriver();
}
use of org.openqa.selenium.chrome.ChromeDriver in project muikku by otavanopisto.
the class AbstractUITest method createChromeHeadlessDriver.
protected WebDriver createChromeHeadlessDriver() {
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--disable-gpu");
WebDriver driver = new ChromeDriver(chromeOptions);
if (getBrowserDimensions() != null) {
driver.manage().window().setSize(new Dimension(toIntExact(getBrowserDimensions().get("width")), toIntExact(getBrowserDimensions().get("height"))));
} else {
driver.manage().window().setSize(new Dimension(1280, 1024));
}
return driver;
}
use of org.openqa.selenium.chrome.ChromeDriver in project muikku by otavanopisto.
the class AbstractUITest method createChromeDriver.
protected RemoteWebDriver createChromeDriver() {
ChromeOptions options = new ChromeOptions();
options.addArguments("--lang=en_US");
options.addArguments("--start-maximized");
ChromeDriver chromeDriver = new ChromeDriver(options);
return chromeDriver;
}
Aggregations