1

I have existing tests written in Java which use Selenium's JavascriptExecutor. These tests pass normally using the regular drivers. However now I'm trying out the PhantomJS driver + GhostDriver to run these tests headless. It seems the JavascriptExecutor is not running and returning a value. Is this a limitation of PhantomJS/GhostDriver or does the driver require a parameter I'm missing to execute the script. I do have

    caps.setJavascriptEnabled(true); 

set in my setup method. Though I belive as of 1.9 Javascript is enabled by default. So does this piece not work at all for GhostDriver or is there something I'm missing?

Scott Arg
  • 46
  • 3
  • There is no way to answer this question as asked. The PhantomJS driver is most assuredly able to execute JavaScript in normal circumstances. Much more information is required, like the JavaScript you are trying to evaluate, and the page against which you're attempting to evaluate it. – JimEvans Jul 10 '13 at 07:49
  • I figured out this situation as a problem with the Javascript .click() event not actually triggering a 'glow' highlighting effect on a text field. The same code works within the Firefox driver but not the PhantomJS. I suspect a limitation in WebKit. So this didn't have anything to do with JS not being executed. – Scott Arg Jul 17 '13 at 15:38

0 Answers0