Reputation: 353
I'm using this code to click on an element: @driver.find_element(:id, "test").click and it works well when I run script on FF16 with Selenium Ruby Webdriver (selenium-webdriver-2.26.0.gem).
However, when trying to run script in IE9 browser (using IE driver: IEDriverServer.exe), no error occurs, but Click event does not work, Selenium seems to ignore this line of code and go to next lines of code.
Note that this issue does NOT happen when I tried to click on many other elements on my application (ex: button, link), it only happens with some elements I want to click.
Please help guide me how to resolve for Selenium to fire Click in IE9 browser. Thanks much.
Upvotes: 0
Views: 384
Reputation: 544
Try click using JavaScriptExecutor or Click after moving to the element. refer below C# code
((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].fireEvent('onclick');", element);
or
Actions action = new Actions(driver);
action.MoveToElement(element).Click().Build().Perform();
where element is IWebElement instance of element to click
Upvotes: 0