2016-04-27 31 views
2

我想在eclipse中使用HTMLunitdriver。不能在Eclipse中使用htmlunitdriver

我已經寫

WebDriver driver = new HtmlUnitDriver(); 

所有jar文件在構建路徑添加的,但我得到的錯誤「司機的HtmlUnit不能解析爲一個類型」。

任何人都可以提供這方面的任何指針?

+0

你使用硒2.53版本 –

+0

可能是你沒有導入WebDriver和HtmlUnitDriver。如果沒有,那就去做吧。 –

+0

嗨,我使用2.53;導入語句也會給出錯誤。 –

回答

5

嗨阿瓊請降級至2.52必將也工作我已經想通了爲什麼它不工作

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. 

請到通過鏈接瞭解更多信息 https://github.com/SeleniumHQ/htmlunit-driver 此外,如果你想繼續用2.53版本請在這裏下載HtmlUnitDriver表格https://github.com/SeleniumHQ/htmlunit-driver/releases

+0

感謝您的信息... –