6.11.25.1.2Chrome 62.0.3202.94 (Official Build) (64-bit)2.33.506120Windows NT 6.3.9600 x86_64var nextButton = element(by.buttonText('Next'));
browser.wait(EC.elementToBeClickable(nextButton), config.minWaitTime)
.then(function() {
nextButton.click();
})
.catch(function(waitError){
console.log('Error occured : ', waitError);
});
Here _nextButton_ element is present at the bottom of the screen and it is invisible (i.e. it is not within Viewport) but enabled, clickable and not having any overlay
Failed: unknown error: Element <button type="button" class="primary active">...</button> is not clickable at point (989, 603). Other element would receive the click: <div class="navItems">...</div>
(Session info: chrome=62.0.3202.94)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.3.9600 x86_64)
Observation
In previous versions of chrome browser v61.0 and chrome driver v2.32 above script was working fine by auto scrolling to the desired element and then click it.
Now it is breaking in the latest environment as mentioned at the top.
Temporary workaround
Using scrollIntoView of the element and then click like -
browser.executeScript("arguments[0].scrollIntoView();", nextButton.getWebElement());
nextButton.click();
This solution works but I will need to make changes in each spec file and for each element. If there lots of element on the page the this solution is not feasible.
Instead of a direct click, use the actions class:
browser.actions().mouseMove(nextButton).click().perform();
Hi @ameetdhage
This is more an issue in ChromeDriver then in Protractor, can you please file a bug there and update the status here?
I'm going to close it for now, but it's still open for discussion.
Hi @FreshQa
Thanks for your suggestion. I tried that but it didn't work for me.
Hi @wswebcreation
I have reported a bug in ChromeDriver community. Here is the link
https://bugs.chromium.org/p/chromedriver/issues/detail?id=2142
Thank you.
@FreshQa @ameetdhage
browser.actions().mouseMove(nextButton).click().perform();
This didn't work for me either, in two steps it did:
browser.actions().mouseMove(nextButton).perform();
browser.actions().click().perform();
In other situations is used:
browser.executeScript(`
const button = document.querySelector('button');
button.click();
`);
Hi,
I'm learning Selenium with Java and I got into this message several times. I sometime fixed the issue in different manners but I'd love to understand what it really means, why it does happen and what would be a proper way to fix this.
The first time I got it I found a code snippet which consist in using JavascriptExecutor to move to the element and click.
Recently for another test case I used Javascript again to scroll the view by a fixed amount of pixels to have the element displayed. It seems to work.
Kind regards.
In my case , The checkbox button has overlapping padding from other div element. I removed the padding from div element which was obstructing the click and then i was able to click it in protractor.
Most helpful comment
Instead of a direct click, use the actions class:
browser.actions().mouseMove(nextButton).click().perform();