Issues using PhantomJS with GhostDriver - phantomJS process hangs around after calling quit

63 views
Skip to first unread message

Meghana Viswanath

unread,
Jun 19, 2015, 10:48:17 AM6/19/15
to phan...@googlegroups.com
Hi,

I am using PhantomJS with GhostDriver in order to generate PDF documents from web pages from my Play/Scala project. So, I am using a simple phantomJS script to do this.
I am on the latest releases of both PhantomJS(2.0) and GhostDriver(1.2.0).

I am having issues trying to close/quit the driver (i.e. calling PhantomJSDriver.close/quit). The close/quit commands do nothing. But when I kill the process manually, I get an error saying - 'UnsupportedCommandException'.

I also tried having a remote phantomjs process running and connecting to it using RemoteWebDriver. But calling the 'RemoteWebDriver.executeScript' method throws up another error - 'Can't find variable: require'. 
My guess is that the PhantomJSDriver uses the PhantomJSCommandExecutor and hence is able to execute the script, but since RemoteWebDriver uses the HttpCommandExecutor, it somehow cannot do it. So, I thought of passing in the phantomJS executor object explicitly to the RemoteWebDriver constructor, but found that PhantomJSCommandExecutor is not public and had to abandon that route.

I am not sure why the quit command does not work.

Any help/suggestion is much appreciated.

Thanks,
Meghana.
Reply all
Reply to author
Forward
0 new messages