When I run test script in headless mode chrome browser, element link is not visible, is not able to do linkElement.click()
. in head mode is everything OK. All other
If changing the window size doesn't work for anyone like me, it may be that the HTML actually changes between headless mode and headed mode.
I had a similar issue, but the headless worked in FireFox and not Chrome. The Xpath for the Chrome element worked only in headed mode. I found out the HTML was changing slightly in Chrome's headless mode.
I fixed this by substituting the Xpath from the element on Chrome with the Xpath from the element on FireFox when using headless mode in Chrome.