Hi I am having some trouble getting a basic protractor test to work.
My setup:
Protractor conf.json:
"use strict"; exports.config = { specs: '../E2ETests/**/*.js', chromeOnly: true, getPageTimeout: 30000, allScriptsTimeout: 30000 }
The test:
"use strict"; describe('When clicking should add stuff', function () { var ptor; beforeEach(function () { browser.get('https://localhost/myApp'); ptor = protractor.getInstance(); }); it('add stuff', function () { // If I comment this, the test pass. element(by.id('add-stuff-button')).click(); // This does not matter fails on the line above.. expect(browser.getTitle()).toBeDefined(); }); });
The error:
UnknownError: unknown error: Element is not clickable at point (720, 881). Other element would receive the click: <div class="col-md-5 col-md-offset-5">...</div> (Session info: chrome=37.0.2062.124) (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64)
Thoughts
The chromedriver do find the button, because if I change the id it complains that no element is found. So I think the problem is that the button moves from its initial position. As the element(***) function should wait for angular to be done, I suspect that its the third party plugins that might interfere as they might not use angular api's fetching data etc. So angular think its done but then the third party plug populates and moves stuff around.
Any ideas what to do? If the third party plugs is the problem, can I somehow tell angular that third party stuff is going on and then later tell it when its done?
Thx Br Twd
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.
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.
WebDriverException - Element is not clickable at point (xx, xx). Other element would receive the click'. This happens when the element is loaded into the DOM, but the position is not fixed on the UI. There can be some other divs or images or ads that are not loaded completely.
What Is the “Element Is Not Clickable at Point” Error? The error “element is not clickable at point” is self-explanatory. It means that the element that you're trying to click on can't be clicked at that particular point. You'd usually find this error when you locate an element and try to execute a click action on it.
You should set window size in your config file
onPrepare: function() { browser.manage().window().setSize(1600, 1000); }
Following worked fine for me:
browser.actions().mouseMove(element).click();
Edit: If above does not work try chaining perform() method too(I got this as an edit suggestion, I have not tested it but somebody could verify it and comment)
browser.actions().mouseMove(element).click().perform();
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