javaselenium-webdriverhtmlunit-driver

Not able to use htmlunitdriver in Eclipse


I'm trying to use HTMLunitdriver in eclipse.

I have written

WebDriver driver = new HtmlUnitDriver();

All the jar files are added in the buildpath, but I'm getting the error "HTMLunit driver cannot be resolved to a type".

Can anyone provide any pointers on this?


Solution

  • Hi arjun please downgrade to 2.52 it will surely work also i have figured it out why its not working

    HtmlUnitDriver was a part of Selenium main distribution package prior to Selenium version
    2.53. If you are using Selenium 2.52 or earlier you don't need to download and install 
    HtmlUnitDriver, it is already there.
    
    According to Selenium evolution strategy drivers should be separated from Selenium, 
    and a driver release cycle should be synchronized with the target browser release cycle 
    instead of Selenium release cycle. So this happened to HtmlUnitDriver too. It's not a part 
    of the main Selenium distribution since version 2.53.
    

    please go through the link for more info https://github.com/SeleniumHQ/htmlunit-driver Also if you want to continue with 2.53 version please download the HtmlUnitDriver form here https://github.com/SeleniumHQ/htmlunit-driver/releases