I've been going through an Angular app I'm working on, testing out CRUD functionality using Protractor for all the different parts of the app. All CRUD pages have create/edit buttons, and the buttons, regardless of what page you're on, all open the same modal whether they are creating or editing.
I am inconsistently running into the issue above. I literally will run the test and it will give me this error and not open the modal, then I'll run it again, and it will open the modal and the same exact test will pass. Then try again to make sure and it fails again. ETC
It's pretty annoying to have the only issues with your tests seem to be an issue with the browser/test suite, and not the actual code. Just to be clear I'm testing this in Chrome.
What would be the way of handling this type of issue, where the problem is the inconsistency of the passing and failing? It's unclear to me exactly what setting needs to be fixed.
The exception “Element is not clickable at point” might be thrown when the element is not under focus or the action is being performed on the incorrect WebElement. In such cases, you have to switch to the actual element and perform the click action.
The solution is to make sure that the overlapping element is closed before you try to click on another element. Another solution is to switch to the layer that contains the element you want to click.
We can get the error - Element is not clickable at point while trying to click a link in Selenium webdriver. This is common in chromedriver as the Chrome browser determines an element with point location. When the position of an element is changing and we make an attempt to click on it, this error is encountered.
It is difficult to say without seeing and running your actual tests, but here are things to try:
maximize the browser window:
browser.driver.manage().window().maximize();
disable all angular animations
use elementToBeClickable
built-in Expected Condition:
var EC = protractor.ExpectedConditions;
var elm = element(by.id("myelement"));
browser.wait(EC.elementToBeClickable(elm), 5000);
scroll into view of the element before clicking it:
browser.executeScript("arguments[0].scrollIntoView();", elm.getWebElement());
move to element before clicking:
browser.actions().mouseMove(elm).click(elm).perform();
click via javascript:
browser.executeScript("arguments[0].click();", elm.getWebElement());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With