Element is not clickable at point in headless mode. But when we remove headless from protractor.conf.js it is working fine.
Asked Answered
D

2

7
element(by.className('cuppa-dropdown')).element(by.className('dropdown-list')).element(by.className('list-area')).element(by.tagName('li')).click();

actually this element is in pop up. ANd it is woring fine in headless mode. But as we need to automate the test cases by build in vsts we need to execute test in headless mode

Failed: unknown error: Element is not clickable at point (863, 343) (Session info: headless chrome=63.0.3239.84) (Driver info: chromedriver=2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 10.0.16299 x86_64)

Defence answered 12/12, 2017 at 16:1 Comment(3)
try to change the browser window size before starting your tests and check if that's the problem. refer #20024067Aeniah
any how we are using this in beforeeach() browser.driver.manage().window().maximize();Defence
issue is occuring becaus of headless mode i.e., args: ["--headless", "--disable-gpu", "--window-size=800x600"],Defence
T
22

As answered above try to set window size as argument for chrome

chromeOptions: {
                args: [
                    '--window-size=1920,1080'],

and

setTimeout(function() {
                browser.driver.executeScript(function() {
                    return {
                        width: window.screen.availWidth,
                        height: window.screen.availHeight
                    };
                }).then(function(result) {
                    browser.driver.manage().window().setPosition(0,0);
                    browser.driver.manage().window().setSize(result.width, result.height);
                });
            }); 
Tiresome answered 12/12, 2017 at 16:37 Comment(6)
where to use setTimeout() functionDefence
we are using browser.driver.manage().window().maximize() in beforeeach()Defence
inside onPrepare() like here github.com/andriyze/proTR/blob/…Tiresome
Previously i was using args: ["--headless", "--disable-gpu", "--window-size=800x600"]. Now as you mentioned args: ["--headless", "--disable-gpu", "--window-size=1920,1080"], it is working fine. Thanks for the helpDefence
Setting the window size alone solved my issue. Thanks!Stanwood
@vikasbiradar you have to set it in protractor.conf.jsTiresome
M
5

It's working fine when changing chrome options in config file from

args: ["--headless", "--disable-gpu", "--window-size=1280x1024"] 

to

args: ["--headless", "--disable-gpu", "--window-size=1920,1080"] 

Thank you so much for the help.

Myology answered 14/8, 2019 at 6:50 Comment(2)
Where we have to edit this ?? Where is config file for this ??Curassow
@Curassow at e2e/protractor.conf.js: config > capabilities > chromeOptions > argsJolda

© 2022 - 2024 — McMap. All rights reserved.