:smile: !
4.4.13.2.2chromeWindows 8.1{
specs: ['myTest.js'],
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 300000 // 5 min
},
capabilities: {
browserName: 'chrome',
shardTestFiles: false,
maxInstances: 1
},
directConnect: true
}
[chrome #01-13] Message:
[chrome #01-13] Failed: unknown error: Element is not clickable at point (189, 1144)
[chrome #01-13] (Session info: chrome=49.0.2623.110)
[chrome #01-13] (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.3 x86_64)
[chrome #01-13] Stack:
[chrome #01-13] WebDriverError: unknown error: Element is not clickable at point (189, 1144)
[chrome #01-13] (Session info: chrome=49.0.2623.110)
[chrome #01-13] (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.3 x86_64)
[chrome #01-13] at WebDriverError (C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:27:10)
[chrome #01-13] at Object.checkLegacyResponse (C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\error.js:580:13)
[chrome #01-13] at C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:360:15
[chrome #01-13] at Promise.invokeCallback_ (C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1329:14)
[chrome #01-13] at TaskQueue.execute_ (C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2790:14)
[chrome #01-13] at TaskQueue.executeNext_ (C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2773:21)
[chrome #01-13] at C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2652:27
[chrome #01-13] at C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7
[chrome #01-13] at process._tickCallback (node.js:369:9)
[chrome #01-13] Error
[chrome #01-13] at [object Object].ElementArrayFinder.applyAction_ (C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\built\element.js:380:21)
[chrome #01-13] at [object Object].ElementArrayFinder.(anonymous function) [as click] (C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\built\element.js:78:17)
[chrome #01-13] at [object Object].ElementFinder.(anonymous function) [as click] (C:\Users\exbuddha\AppData\Roaming\npm\node_modules\protractor\built\element.js:708:7)
Run my test. I can provide source code upon request since it would involve some work for me to take out the confidential stuff. To add some more, I am hitting a standard AngularJS page and whenever the page content is hidden by window size, the elements that are not visible cannot be clicked on or interacted with in any way. This is a new issue as I mentioned earlier. The old behavior was that I would see the browser automatically scroll to the element location and then the action would take place. Now, after installing the latest version of Protractor, the scrolling does not happen anymore and the error above is thrown.
After doing some looking around, it looks like that is an issue that has been known for a while and there are lots of different scenarios that people have described where they see this error pop up. So, it might not be exactly "random" and there might be a test-specific cause for this. Again, if this issue ever gets escalated for debugging I can provide more details about the test script and other pieces at work. Thanks.
Webdriver behavior should be to scroll so that the element is at the top of the page (if not already visible), then try clicking on its center. If you see something else occurring, this may be an issue with chromedriver.
It would be helpful if you can provide a specific reproducible case (ideally in a repo that we can just run) and also confirm that it used to work with an earlier version.
Thank you. That was my guess too. I should add that the behavior only happens in Chrome and that I have seen the same error showing up randomly in the past. It is unfortunately very annoying and I speculate it is hard to debug as well.
Anyway, I will try to setup a test script that you can run over the Internet.
Hello, I don't think that it is a bug of ChromDriver.
I also have such problems and the element for click was really not clickable.
Possible reasons:
You should be shure that at the click moment the element can be clickable.
Possible solutions, actions before click:
1) element.getLocation().then(function (navDivLocation) {
var initTop = (navDivLocation.y - 150) > 0 ? navDivLocation.y - 150 : 1; // it is my approach and you can don't change it is value
var initLeft = navDivLocation.x;
browser.executeScript('window.scrollTo(' + initLeft + ',' + initTop + ');');
});
2) browser.driver.executeScript("arguments[0].scrollIntoView();", element.getWebElement());
browser.waitForAngular();
browser.wait(function {
return element.isDisplayed().then((res)=>{
return res;
}, ()=>{
return false;
});
}, [time_for_wait], "Wait untill element presesnt and displayed.");
element.getWebElement().then(function(elm){
return browser.executeScript("$(arguments[0]).click();", elm)});
If these approaches will not help, then it is can be some bug.
Thanks for the help. I am sure that the element is present and visible in the page before the test schedules the click command. This error happens randomly enough for me that makes it impossible to debug yet and I don't have enough knowledge of the underlying tools to investigate this more. I am almost positive that it is a framework/driver issue and not a test script flaw based on the fact that I do get some random passes and some random failures when I run the same test back to back and I also see different results in different browsers.
I am trying to create a stripped down page using jsbin and will share more at that point. Hopefully some time this week.
Unfortunately, all my efforts to recreate a page that would show this bug have been unsuccessful. I can't get a consistent repro for this issue.
For whatever's worth, I finally found the root cause of this error. In this case, the web app is written in a way that it changes app from time to time. For instance, after a logout, the entire angular app is reassigned. This is a development restriction that our team had to abide to given the nature of our product. So, the bottom line was to add some sleeps in between the action that causes the app to change and the next (scheduled) action.
Even though adding sleeps was the last thing I wanted to do when I start using Protractor, it seems that in this particular case that is the only feasible solution.
I had similar problem. It was giving "Element is not clickable at point" at some specific points. After wasting few hours, I found the cause.
In my case, only 1px of a button was visible due to scroll position. Rest of button was not visible, which was causing this "Element is not clickable" error. I solved it by manually scrolling up a a bit.
What exbuddha is describing is spot on. If your app is mobile/dynamic, chromedriver stops working properly for clicks because the position seemingly changes. Literally the only solution I've found is to pause for a MINIMUM of 200 ms. I am using nightwatch and found this issue after a lot of searching.
Looking at older issues, it seems this won't get fixed anytime soon either, which is a shame for all devs potentially running into this sooner or later.
I had the same issue, was solved after updating chromedriver.
browser.actions().mouseMove({x: -250, y: -250}).click().perform()
try this code
Most helpful comment
Hello, I don't think that it is a bug of ChromDriver.
I also have such problems and the element for click was really not clickable.
Possible reasons:
You should be shure that at the click moment the element can be clickable.
Possible solutions, actions before click:
1)
element.getLocation().then(function (navDivLocation) { var initTop = (navDivLocation.y - 150) > 0 ? navDivLocation.y - 150 : 1; // it is my approach and you can don't change it is value var initLeft = navDivLocation.x; browser.executeScript('window.scrollTo(' + initLeft + ',' + initTop + ');'); });2)
browser.driver.executeScript("arguments[0].scrollIntoView();", element.getWebElement());browser.waitForAngular();browser.wait(function { return element.isDisplayed().then((res)=>{ return res; }, ()=>{ return false; }); }, [time_for_wait], "Wait untill element presesnt and displayed.");element.getWebElement().then(function(elm){ return browser.executeScript("$(arguments[0]).click();", elm)});If these approaches will not help, then it is can be some bug.