Hi,
I am doing some automation of website on Android emulator (using platform version 5.0.1 and API 21)
I tried using below code ...
Driver Setup Code
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "5.0.1");
capabilities.setCapability("deviceName", "Nexus7");
capabilities.setCapability("browserName", "Browser");
driver = new RemoteWebDriver(new URL("http://192.168.1.17:4723//wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
And Code for taking screenshot:
WebDriver driver1 = new Augmenter().augment(driver);
File file = ((TakesScreenshot) driver1).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(file, new File("Screenshot.png"));
But getting following exception ...
unknown error: cannot activate web view
(Session info: webview=)
(Driver info: chromedriver=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 94 milliseconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: xxxxxxxxxx
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=, platform=ANDROID, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 98d6e4fb5a03da367a2821bd3e221e55