7.2
JSON wire
プロトコル
141
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setBrowserName("firefox");
WebDriver remoteWD = null;
try {
remoteWD = new RemoteWebDriver(new
URL("http://10.172.10.1:4444/wd/hub"),capabilities);
} catch (MalformedURLException e) {
e.printStackTrace();
}
remoteWD.get("http://www.google.com");
WebElement element = remoteWD.findElement(By.name("q"));
element.sendKeys("Packt Publishing");
remoteWD = new Augmenter().augment(remoteWD);
File scrFile = ((TakesScreenshot)remoteWD).
getScreenshotAs(OutputType.FILE);
System.out.println(scrFile.getAbsolutePath());
}
}
7.2
JSON wire
プ ロト コ ル
...