Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

Print

How to run the tests without a browser or with HTML unit driver in selenium webdriver

We need to use HtmlUnitDriver to run tests with html without using UI. 

This is currently the fastest and most lightweight implementation of WebDriver. As the name suggests, this is based on HtmlUnit. HtmlUnit is a java based implementation of a WebBrowser without a GUI. For any language binding (other than java) the Selenium Server is required to use this driver.

WebDriver webDriver;    
 webDriver=new HtmlUnitDriver();  
 String URL="http://www.seleniummaster.com";   
 webDriver.get(URL);  //Navigate to URL