protractor
protractor copied to clipboard
Implement elementNotToBeCovered for ExpectedConditions library
See https://github.com/angular/protractor/issues/2139
Really need this. It would solve a big problem
This is exaclty our issue in globaleaks dealing with application loader and asyncronous operations.
+1
Really need this for pop ups and overlays that appear on top of the page, the ExpectedConditions.elementToBeClickable does not help in this case...
Yes this! I am constantly running into "Element is not clickable at point (x,y). Other element would receive the click:" errors after scrolling and trying to click an element.. but only like ~14% of the time.. frustrating. Even waiting for elementVisible or elementToBeClickable doesn't always work.
+1
+1
+1
I'd like to see this functionality released ASAP. This issue is so annoying. Is there any workaround for it?
+1
+1
+1
+1
@sjelin you mention that this could be done in another thread, right?
We would address this using document.elementFromPoint and element.getBoundingClientRect pretty easily actually. elementFromPoint isn't totally standard at this point, though it appears to be supported by all browsers. The consistency issue is real though. Donno if we should leave this the way it is or "fix" it
+1000000000
+999
+2000000
+2000000
+999
+1
+1
+1
+1 EDIT: Sorry then. I've seen it as pretty common practice elsewhere to vote on issues with a +1 and this is a problem I've run a lot writing protractor tests so I'd be interested in seeing it implemented. I'll remember that for the future though.
Please stop +{number} this PR. This doesn't help...
Any update on this? For my use case, I'm using the following to scroll the element into view, but I know this isn't a solution for all use cases such as modals and such.
var el = $('.myElement');
browser.executeScript('arguments[0].scrollIntoView()', el.getWebElement());
We've developed a workaround for now. We identify the element (id="spinner"
) that is "blocking" the element that we actually want to click and simply just wait for the blocking element to be invisible like so:
broswer.wait(EC.invisibilityOf($(‘#spinner’)), 5000)
EC.invisibilityOf
isn't always enough. Sometimes Protractor reports an element as being covered by another element that shouldn't be invisible.
For instance, in one of my tests, a link is reported as being covered by its parent div, and invisibilityOf
will wait forever. Seconding the desire for toNotBeCoveredBy
This issue is 2 years old. Is there any solution for this already, because I cannot find it and I am still encountering this problem? In my situation I cannot wait for element to be invisible, because the covering element is not going to be invisible at any point and it is not visually covering the element, but I still get the error for not clickable at point, because another element would receive the click.
+1 for the "toNotBeCoveredBy"
I have solved such issue in one case with the following:
"use strict";
function elementWithAttributeHasNotValue(htmlElement, attribute, value) {
return htmlElement.getAttribute(attribute).then((elementAttribute) => {
return !elementAttribute.includes(value);
});
}
class Helper {
waitForAngularInRoomAnimationToBeDone() {
const inRoomElement = element(by.className("in-room"));
browser.wait(elementWithAttributeHasNotValue(inRoomElement, "class", "ng-animate"), browser.params.DEFAULT_TIMEOUT_MS);
}
}
module.exports = Helper;
The name of the method and of the constant are specific from my use case, but I think the rest could be used in a more generic way.
Then in my test I use it like this:
helper.waitForAngularInRoomAnimationToBeDone();
The thing is that in my situation, when I look at the screenshot of the error, which is capturing the state of the browser screen at the moment of the error, everything looks fine and the element I want to click is visible, but Protractor is still reporting that the element is not clickable, because another would receive the click and waiting for element to be visible or enabled doesn't work as the element is already visible on the screen and is enabled. I have this issue in Chrome and it is not appearing every time, only like 20% of the time. I tried the code above, but it does not work for me.