Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 Selenium-RC(JUnit、Eclipse 和 Java)中截屏。我想在任何我想要的地方截屏,而不仅仅是测试失败。提前致谢。
您可以使用
selenium.captureScreenshot("/tmp/" + this.getClass().getName() + "." + testMethodName + ".png");
或者
selenium.captureEntirePageScreenShotToString();
selenium.captureEntirePageScreenshot("C:\screenshot.png","");