I am facing below issue while running scripts on chrome headless using Selenium java and in Windows OS. URL is not opening i am getting null as a title of page for my application URL..chrome driver version 2.33 ,chrome browser 62..I am using below code
System.setProperty("webdriver.chrome.driver", chromedriver.exe);
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("window-sized1200,600");
ChromeDriver driver = new ChromeDriver(chromeOptions);
driver.get("app url");
System.out.println(driver.getTitle)
Is it because by app URL is not supported headless mode ..not getting any exception..
There is a typo in your window size argument and you call addArguments but you only add one argument per call, try this
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("headless", "window-size=1200,600");
ChromeDriver driver = new ChromeDriver(chromeOptions);
driver.get("your.app.url");
System.out.println(driver.getTitle)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With