Java 如何使用selenium capturescreen并保存到jenkins项目中?

Java 如何使用selenium capturescreen并保存到jenkins项目中?,java,maven,selenium,jenkins,Java,Maven,Selenium,Jenkins,我尝试了很多方法,但仍然坚持。 我使用代码: File f = new File("reports.png"); selenium.captureEntirePageScreenshot(f.getAbsolutePath(), ""); 我也试过了 protected String dir_path = System.getProperty("user.dir"); 没有结果。我在jenkins项目文件夹中找不到任何图像。 我尝试了*iexplore,但后来我出现了错误,因为seleniu

我尝试了很多方法,但仍然坚持。 我使用代码:

File f = new File("reports.png");
selenium.captureEntirePageScreenshot(f.getAbsolutePath(), "");
我也试过了

protected String dir_path = System.getProperty("user.dir");
没有结果。我在jenkins项目文件夹中找不到任何图像。 我尝试了*iexplore,但后来我出现了错误,因为selenium在使用iexplorer时无法进行屏幕截图。所以我改成了*firefox

Jenkins集。您可能正在查找WORKSPACE变量

*firefox *firefox