SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

IEDriver Click Fails with Native Events = false #6515

Open lukeis opened 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 6515

In this test, a click needs to be performed to toggle the expanded state of a tree node.

When native events are disabled, clicking the toggle does not expand the node.  When
native events are enabled, the node is expanded correctly when clicked.

This is a reproducible test script that is executed on the tree control from Telerik's
demo site.  This test is attempting to click on the toggle next to the "Zanzibar" node,
which should result the node being expanded.

InternetExplorerOptions options = new InternetExplorerOptions();
options.EnableNativeEvents = false;

IWebDriver driver = new InternetExplorerDriver(options);
driver.Navigate().GoToUrl("https://demos.telerik.com/aspnet-ajax/treeview/examples/overview/defaultcs.aspx");

IWebElement toggle = driver.FindElement(By.XPath("//span[contains(text(),'Zanzibar')]/preceding-sibling::span[@class
='rtPlus']"));
toggle.Click();

WebDriver 2.37
IEDriverServer 2.37
Internet Explorer 9

Reported by nathandace on 2013-10-31 19:22:27


lukeis commented 8 years ago

Reported by barancev on 2013-10-31 20:50:02

lukeis commented 8 years ago
Adding log file for IE10, and where protected mode settings are not set to be ignored,
for good measure.

Reported by nathandace on 2013-11-07 16:36:25


lukeis commented 8 years ago
Clicking the element via the IE console works using document.getElementByClassName("rtPlus")[7].click()

Likewise, the following code will also reproduce the click failure:

InternetExplorerOptions options = new InternetExplorerOptions();
options.EnableNativeEvents = false;

IWebDriver driver = new InternetExplorerDriver(options);

driver.Navigate().GoToUrl("http://demos.telerik.com/aspnet-ajax/treeview/examples/overview/defaultcs.aspx");
var elements =  driver.FindElements(By.ClassName("rtPlus"));

// This click works.
((IJavaScriptExecutor) driver).ExecuteScript("arguments[0].click()", elements[7]);

// This click does not.
elements[7].Click();

Reported by nathandace on 2013-11-20 01:29:43

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 17:45:56