Can I perform following functions using HTML Unit Driver headless browser automation?<ol><li>Is it possible to take snapshot?</li> <li>Can click any hyperlink ?</li> <li>Possible to handle pop-ups?</li> </ol>
I am planning to do automation using HTMLUnit driverAnswer1:
Yes, You can perform all operations as per of your all 3 point using headless browser. Don't use
HTMLUnit as it have many configuration issue.
PhamtomJS was another approach for headless browser but PhantomJs is having bug these days because of poorly maintenance of it.
You can use chromedriver itself for headless jobs.
You just need to pass one option in chromedriver as below:-
Full code will appear like this :-
System.setProperty("webdriver.chrome.driver","D:\\Workspace\\JmeterWebdriverProject\\src\\lib\\chromedriver.exe"); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--headless"); chromeOptions.addArguments("--start-maximized"); WebDriver driver = new ChromeDriver(chromeOptions); driver.get("https://www.google.co.in/");
Hope it will help you :)