Headless Browser-Selenium,HTMLUnitDriver

Headless Browser-Selenium,HTMLUnitDriver

Refer to the below Links for Practise
Selenium Wiki
Complete List of Selenium Basics
50 Real Time Interview Questions
Real Time Scenario’s
Java Platform Standard Edition 8 Documentation
Complete List of Java Basics
Java Quiz
Java OOPS Quiz
Selenium Advanced Quiz
Selenium Quiz
Selenium WebDriver Resume

HtmlUnit

is a “GUI-Less browser for Java programs”. It has fairly good JavaScript support (which is constantly improving) and is able to work even with quite complex AJAX libraries, simulating Chrome, Firefox or Internet Explorer depending on the configuration used.
It is typically used for testing purposes or to retrieve information from web sites. HtmlUnit is not a generic unit testing framework. It is specifically a way to simulate a browser for testing purposes and is intended to be used within another testing framework such as JUnit or TestNG.

Refer to the document “Getting Started with HtmlUnit” for an introduction.

Selenium WebDriver Example:

1. Add the “htmlunit-driver-xxx-jar” from maven repository using the Download Link.
http://central.maven.org/maven2/net/sourceforge/htmlunit/htmlunit/2.13/htmlunit-2.13.jar
2. Add the downloaded jar to the build path of the project.
3. Execute the below program:

Console Ouput:

Title:Job Search India | Indeed
Title:Selenium Jobs in Bengaluru, Karnataka – June 2018 | Indeed.co.in

Leave a Reply

Your email address will not be published. Required fields are marked *