Selenium Webdriver cannot click button on IE

13 August, 2015
Today I was running some tests on IE which always have run smoothly before. Even though WebDriver was able to locate the button it was not able to click it.

There were NO errors or exceptions shown. This action is just ignored.

@FindBy(id = "loginBtn")
private WebElement btnLogin;
...
btnLogin.click();


Tried different things like setting different values of Capability paramters (true/false).
capability.setCapability("NativeEvents", false);

But the link is not clicked.

One solution that worked was:
driver.findElement(By.id("loginBtn")).sendKeys(KEYS.ENTER);

But this was not a permanent solution for me because I has the tests working without this.

After much googling and trying different things, I found that the problem was due to Zoom level set to anything but 100%. It was 105% in my case. Once adjusted to 100% it worked as expected.

This is already reported on the wiki page for the IE driver.


No comments:

Post a Comment