Pages

Showing posts with label HtmlUnitDriver. Show all posts
Showing posts with label HtmlUnitDriver. Show all posts

Monday, 6 February 2012

How can I instantiate HTMLUnitDriver?

The HTMLUnitDriver can be instantiated as below:


WebDriver driver = new HtmlUnitDriver(); // Instantiate the class - org.openqa.selenium.htmlunit.HtmlUnitDriver

Sample code:


package tests;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class HTMLUnitDriverSample {
public static void main(String[] args) {
// Instantiate the HTMLUnitDriver
WebDriver driver = new HtmlUnitDriver();

// Visit the Selenium-WebDriver FAQ site
driver.get("http://seleniumwebdriverfaq.tumblr.com/");

// Print the title of the page - It should print"Selenium-WebDriver FAQ's"
System.out.println("Title of the page is: " + driver.getTitle());

}
}

What are the different implementations of WebDriver available?

Below are the WebDriver implementations available as off now:


1. HtmlUnitDriver
2. FirefoxDriver
3. InternetExplorerDriver
4. ChromeDriver
5. OperaDriver


6. AdroidDriver
7. IPhoneDriver

You can find out more information about each of these by following the links.

From where can I download set of Selenium tools?

Link below is where you can find the latest releases of all the Selenium components:


http://seleniumhq.org/download/