我目前正在扩展我的测试,以涵盖使用 Selenium webdriver for IE (IEDriverServer.exe) 的 Internet Explorer。
我的问题是,当我使用 IE webdriver 执行测试时。当我运行测试时,Internet Explorer Webdriver 打开,我可以输入地址,但是当实际执行其余脚本(例如输入链接、按各种按钮等)时,测试会因超时而崩溃。
注意:测试在 Chrome 和 Firefox 上按预期执行。
EDIT:
try {
driver.findElement(By.id("topmenuImg")).click();
}
catch (NoSuchElementException ex) {
JOptionPane.showMessageDialog(null, "Not possible");
}
当您在 firefox 中运行测试时,Internet Explorer 非常慢,它工作得很好,因为 Firefox 搜索非常快,添加适当的等待并增加定位对象的时间,将时间增加到 2 分钟 = 120 秒
C# 的例子是
InternetExplorerDriver driver = new InternetExplorerDriver(@"c:\path", options, TimeSpan.FromMinutes(2));
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)