对于下面的HTML源代码,我正在尝试使用Selenium Webdriver C#库单击菜单项--Employer。我使用下面的xpath,它在chrome和firefox中运行良好,但它不能在IE中工作。在IE中单击菜单项,但菜单下的菜单项未填充
actions.MoveToElement(driver.FindElement(By.CssSelector("li[title=\"Employer\"]"))).Build().Perform();
driver.FindElement(By.XPath("//span[contains(text(),'Employer')]")).Click();
driver.FindElement(By.CssSelector("li[title=\"Employer\"] > a > span")).Click();
我尝试过点击和鼠标悬停等多项内容,但在IE中没有任何效果。不确定我还能尝试使其工作
HTML页面源代码
InternetExplorerOptions options = new InternetExplorerOptions();
options.EnableNativeEvents = false;
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
options.EnsureCleanSession = true;
options.IgnoreZoomLevel = true;
options.EnablePersistentHover = false;
options.UnexpectedAlertBehavior =
InternetExplorerUnexpectedAlertBehavior.Accept;
options.RequireWindowFocus = true;
var IEoptions = new InternetExplorerOptions(){
IntroduceInstabilityByIgnoringProtectedModeSettings = true
};
driver = new InternetExplorerDriver("location", options);
我尝试过的事情
datetime>=DATE_ADD(NOW(), INTERVAL -1 HOUR);
datetime>= DATE_sub(NOW(), INTERVAL 1 HOUR);
Webdriver的IE设置
col-screen-8