ElementNotVisibleException when use headless Chrome browser

后端 未结 4 2519
慢半拍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 02:56

    options.addArguments('window-size=1200,1100');

    Worked for me in headless chrome mode :) Thanks a lot @powerpete

    Below are the complete settings for headless chrome in groovy:-

            ChromeOptions options = new ChromeOptions()
            DesiredCapabilities capabilities = DesiredCapabilities.chrome()
            options.addArguments('headless','disable-gpu','--test-type','--ignore-certificate-errors')
            options.addArguments('window-size=1200,1100');
            capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
            capabilities.setCapability(ChromeOptions.CAPABILITY, options)
            driver = {new ChromeDriver(capabilities)}
    

提交回复
热议问题