I could not create HtmlUnitDriver even though I included selenium-java-2.53.0.jar and ALL jars in lib folder. The reason was 'NoClassDefFoundError: org/openqa/selenium/HasInputDevices' So I got selenium api jar files (selenium-api-2.53.0.jar, guava-19.0.jar, gson-2.3.1.jar). But HasInputDevices.class is under org/openqa/selenium/interactions and not under org/openqa/selenium/ and I am still getting same error.
There were 2 other threads on this topic that I went through, but it did not help.
I am uploading a zip file of my project. My class: import org.openqa.selenium.htmlunit.HtmlUnitDriver; import org.openqa.selenium.interactions.*;
public class BrowserTests {
public static void main(String[] args) { //FirefoxDriver fd = new FirefoxDriver(); HtmlUnitDriver hd = new HtmlUnitDriver(); System.out.println("Opening URL"); hd.get("http://www.bbc.com"); System.out.println("Getting Title"); hd.getTitle(); System.out.println("Got title");