我需要在Selenium-RC(JUnit,Eclipse和Java)中截取屏幕截图。我想在我想要的任何地方截取屏幕截图,而不仅仅是测试失败。提前谢谢。
答案 0 :(得分:4)
您可以使用
selenium.captureScreenshot("/tmp/" + this.getClass().getName() + "."
+ testMethodName + ".png");
OR
selenium.captureEntirePageScreenShotToString();
OR
selenium.captureEntirePageScreenshot("C:\screenshot.png","");