ElementNotVisibleException when use headless Chrome browser

后端 未结 4 2496
慢半拍i
慢半拍i 2021-02-20 02:25

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

4条回答
  •  走了就别回头了
    2021-02-20 03:02

    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.

提交回复
热议问题