Headless Testing becomes easy now with Chrome and Firefox


headless-browsers-730x365

 

Headless Testing with Chrome and Firefox using Selenium WebDriver(latest version) becomes easy now:-

-For Chrome (latest Version): System.setProperty(“webdriver.chrome.driver”,”chromedriver exe path”);

ChromeOptions chromeOptions = new ChromeOptions();

chromeOptions.addArguments(“–headless”);

driver = new ChromeDriver(chromeOptions);

-For Firefox 57(Quantum):

System.setProperty(“webdriver.firefox.driver”,”firefoxdriver exe path”);

FirefoxOptions firefoxOptions = new FirefoxOptions(); firefoxOptions.setCapability(“marionette”, true);

firefoxOptions.setHeadless(true);

driver = new FirefoxDriver(firefoxOptions);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.