我正在尝试在IE上运行我的测试。问题是在Firefox上它可以工作,但是当我尝试在IE上运行它时,它会打开浏览器,导航到我的站点,但是在页面完成加载之后返回以下错误:
com.thoughtworks.selenium.SeleniumException: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 302 milliseconds
Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:08:45'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_25'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:42)
at org.openqa.selenium.internal.seleniumemulation.Timer.run(Timer.java:39)
at org.openqa.selenium.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:145)
at org.openqa.selenium.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:75)
at com.thoughtworks.selenium.DefaultSelenium.focus(DefaultSelenium.java:221)
at com.extjs.selenium.form.TextField.setValue(TextField.java:127)
我的代码:
public void setUp(String server, String browser) throws Exception {
WebDriver driver = getWebDriver(InputData.BROWSER);
selenium = new WebDriverBackedSelenium(driver, server);
}
public WebDriver getWebDriver(String browser) {
if (browser.equalsIgnoreCase("*firefox")) {
return new FirefoxDriver(firefoxProfile);
} else if (browser.equalsIgnoreCase("*iexplore")) {
return new InternetExplorerDriver();
} else if (browser.equalsIgnoreCase("*chrome")) {
return new ChromeDriver();
} else if (browser.equalsIgnoreCase("*htmlunit")) {
return new HtmlUnitDriver(true);
} else {
logger.error("Browser not supported");
return null;
}
}
任何人都可以帮我这个吗?我被困在尝试让它在IE上运行。我正在使用可以从http://code.google.com/p/selenium/downloads/list
下载的最新驱动程序由于