一下代码会报异常:
public static void main(String[] args) {
// TODO Auto-generated method stub
//实现截图功能
DefaultSelenium selenium = new DefaultSelenium("localhost",
4444,"*iexplore","http://www.baidu.com");
selenium.start();
selenium.open("http://www.baidu.com");
selenium.captureEntirePageScreenshot("E:\\123", "");
}
ERROR: captureEntirePageScreenshot is only implemented for Firefox ("firefox" or "chrome", NOT "firefoxproxy") and IE non-HTA ("iexploreproxy", NOT "iexplore" or "iehta"). The current browser isn't one of them!
这个异常是指截图功能不能再IE浏览器上运行selenium的截图功能只能在浏览器“*Chrome”、“*Firefox”
解决办法:
DefaultSelenium selenium = new DefaultSelenium("localhost",
4444,"*iexplore","http://www.baidu.com");