Reputation: 77
Some elements are not clicked with selenium2 in IE
Throws Error: The point at which the driver is attempting to click on the element was not scrolled into the viewport. (WARNING: The server did not provide any stacktrace information)
Browser: IE 11 IEDriverServer: 2.39 Selenium server: 2.37
Tried with IEDriverServer 2.28, click works but there are some other things that does not work being an old version. Tried with jquery click but it gives problems with other testcases.
Please post solutions or suggestions.
Thanks!
Upvotes: 0
Views: 595
Reputation: 1036
Officially IE11 isn't in the support list of WebDriver currently, still for a work around you may try moving the focus on element first and then perform the click and if this fails you can try clicking using javascript click method
try {
Actions action = new Actions(driver);
WebElement element = driver.findElement(By.xpath("XPATH_HERE"));
if (element != null) {
action.moveToElement(element).build().perform();
element.click();
return;
}
throw Exception("Element not found to perform click");
}catch (Exception e) {
try {
(new JavascriptLibrary()).executeScript(driver, "arguments[0].click()", driver.findElement(By.xpath("XPATH_HERE")));
return;
}
} catch (Exception e1) {
e1.printStackTrace();
}
e.printStackTrace();
}
Upvotes: 1