Selenium webdriver is unable to locate element in chrome headless mode Selenium webdriver is unable to locate element in chrome headless mode selenium selenium

Selenium webdriver is unable to locate element in chrome headless mode


try changing screen size to "1920x1080" sometimes you do find trouble when screen size is inappropriate.


Can you please try with the belwo settings:

options.addArguments("window-size=1400,800");options.addArguments("headless");


In order to use headless chrome using ChromeOptions in java you are supposed to use --headless, you may just replace:

options.addArguments("headless");

with:

options.addArguments("--headless");