Urgent Please --- How to use Javascript in htmlunit Driver | Selenium Forum
M
Posted on 27/12/2016
I am using selenium 2.53 version of selenium . Htmlunit driver is not responding to javascript .

When making the Htmlunit as true.
Webdriver driver = new HtmlUnitDriver(true);
It throws an error message ,
com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function addEventListener in object [object Window].



Even HtmlUnit driver is not supporting to Xpath
When i am using Xpath as ("//*[@id='login']/span") -- > it throws an error Unable to locate element.
But whereas xpath like ("//*[@id='login']") -- > is supporting to such xpath

Please help me on this.

Thanks,
sachin

M
Replied on 27/12/2016

it seems there is a bug in HTML unit driver

source: http://stackoverflow.com/questions/24790826/htmlunit-and-document-addeventlistener