我能够使用下面的代码成功地截取我的应用程序JainLibrary的页面之一.我正在使用junit和appium.
public String Screenshotpath = "Mention the folder Location";
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(Screenshotpath+"Any name".jpg"));
Run Code Online (Sandbox Code Playgroud)
现在我想将屏幕截图与参考图像进行比较,以便我可以继续使用测试用例.