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
You can do this in two ways as below.
1.Passing window size in chrome options as mentioned below(Before instantiating driver instance):
ChromeOptions options = new ChromeOptions()
options.addArguments("headless");
options.addArguments("window-size=1200,1100");
WebDriver driver = new ChromeDriver(options);
2.Set window size after instantiating chrome driver:
WebDriver webDriver= new ChromeDriver();
webDriver.manage().window().setSize(new Dimension(1200,1100));