Java Selenium getScreenshotAs ubuntu堆栈

时间:2018-09-15 09:21:40

标签: java selenium ubuntu

因此,我具有此功能,可以在测试失败的情况下捕获screenshot

public static String captureScreenshot(String testName) throws IOException {
     File screenshotFile = takesScreenshot.getScreenshotAs(OutputType.FILE);
     String path = "./screenshots/" + testName + ".png";
     FileUtils.copyFile(screenshotFile, new File(path));
     return path;
}

因此,此方法在Windows上可以正常使用,但在Ubuntu上似乎存在一些死锁,或者它卡在方法的第一行。

我一遍又一遍,甚至等待了几分钟,什么也没发生,只是卡住了。

0 个答案:

没有答案