我已经编写了一个java代码来捕获使用selenium web驱动程序的网页截图,通常java代码运行良好,但在servlet中使用相同的代码会给我一个错误。
package CaptureImages;
public class SeleniumTest extends HttpServlet{
private static final long serialVersionUID = 1L;
public void service(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException{
WebDriver driver_rbi = new FirefoxDriver();
// WebDriver driver_rbi=new HtmlUnitDriver(); //html unit driver
driver_rbi.get("http://www.rbi.org.in/commonman/English/Scripts/BanksInIndia.aspx");
try{
//CaptureRBI.captureRBIScreens();
System.out.println("webpage launched...");
//File scrFile = ((TakesScreenshot) driver_rbi).getScreenshotAs(OutputType.FILE);
//FileUtils.copyFile(scrFile, new File("C:\\Users\\srawat2\\Desktop\\surya code\\selenium\\ScreenShots\\RBI\\RBI.png"));
System.out.println("Quiting driver...");
//driver_rbi.quit();
}
catch(Exception e){
}
// PrintWriter out = response.getWriter();
}
} 错误:java.lang.ClassNotFoundException:com.google.common.base.Function