0
我只想在使用appium的混合Android应用程序中截取Webview部分的截图。如何截取webview部分的截图仅使用Appium
我用下面的代码来截图。
String Screenshotpath = System.getProperty("user.dir") + "/";
System.out.println(Screenshotpath);
File scrFile = ((TakesScreenshot) driver)
.getScreenshotAs(OutputType.FILE);
System.out.println(scrFile);
try {
FileUtils.copyFile(scrFile, new File(Screenshotpath
+ "screenshotwebview" + ".jpg"));
} catch (IOException e) {
e.printStackTrace();
}
它工作正常,并采取整个屏幕的屏幕截图。但是,当我尝试设置上下文的WebView并尝试使用上面的代码显示了以下错误
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.
Original error: Could not proxy. Proxy error: Could not proxy command to remote server.
Original error: Error: ESOCKETTIMEDOUT (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds
是否有可能采取的WebView的截图采取截图部分只使用Appium?
任何一个请帮忙
你能检查我的答案吗? – KeLiuyue