Why doesn't HtmlUnitDriver execute JavaScript?

前端 未结 5 1834
滥情空心
滥情空心 2020-12-20 12:00

I got the following problem: I am running a JUnit testCase with Selenium 2.9 using HtmlUnitDriver with Browserversion Firefox_3_6. JavaScript is enabled. Now when it should

5条回答
  •  时光说笑
    2020-12-20 12:54

    You may need to do this:

    WebDriver driver = new HtmlUnitDriver(BrowserVersion.INTERNET_EXPLORER_8);
    ((HtmlUnitDriver) driver).setJavascriptEnabled(true);
    

提交回复
热议问题