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
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)}