【发布时间】:2015-03-05 05:06:18
【问题描述】:
为了测试一些遗留页面,我需要针对IE8 执行一些测试用例。这些相同的测试用例有效地针对IE10/11, FF, Chrome 运行,没有任何问题。
public void TypePassword(string password)
{
var element = new WebDriverWait(Driver, TimeSpan.FromSeconds(10)).Until(
ExpectedConditions.ElementIsVisible(By.XPath("//input[@id='txtPassword']")));
//I also tried with just id and cssselector
element.Clear();
element.SendKeys(password);
}
我也试过了
public void TypePassword(string password)
{
Password.Clear();
Password.SendKeys(password);
}
有趣的是,
public void TypeUsername(string username)
{
Username.Clear();
Username.SendKeys(username);
}
始终正常工作。
The IE driver configuration
var options = new InternetExplorerOptions { EnableNativeEvents = false};
options.AddAdditionalCapability("EnsureCleanSession", true);
Driver = new InternetExplorerDriver(options);
似乎我缺少一些特定于 IE8 的配置。
另外,确认缩放级别和保护模式设置
【问题讨论】:
标签: selenium selenium-webdriver internet-explorer-8 webdriver ie8-compatibility-mode