I have the following problem
java -jar selenium-server-standalone-2.53.0.jar -role hub
phantomjs --webdriver=8090 --webdriver-selenium-grid-hub=http://localhost:4444
but got Error:
[INFO - 2016-03-25T13:56:28.397Z] GhostDriver - Main - running on port 8090 [INFO - 2016-03-25T13:56:28.397Z] GhostDriver - Main - registering to Selenium HUB 'http://localhost:4444' version: using '127.0.0.1:8090' with org.openqa.grid.selenium.proxy.DefaultRemoteProxy as remote proxy. [ERROR - 2016-03-25T13:56:28.400Z] GhostDriver - main.fail - {"line":97,"sourceURL":"phantomjs://platform/hub_register.js","stack":"register@phantomjs://platform/hub_register.js:97:79\nglobal code@phantomjs://code/main.js:78:37"}
phantomjs://platform/console++.js:263 in error
Standard node works ok, but PhantomJS failes. What I'm doing wrong?
For anyone still looking, there are linux and windows x64 builds available here with the workaround of v2.1.1 (windows build is on a pull request - the hex editor workaround wont work for windows cos the .exe's are compressed)
https://github.com/mrorgues/PhantomJSCustomEdition
I have spent 2 months trying to fix this problem, trying everything possible, my main issue was that many solutions won't connect to the grid, and ones that do are in docker containers what can only connect to a local grid hosted on the same Docker host.
So... I finally built my own solution which works: https://github.com/madhavajay/selenium-node-phantomjs
Docker image is madhavajay/selenium-node-phantomjs
It uses PhantomJS 2.1.1 Custom Build with fixed Ghostdriver and then my own tweaks to the latest fork of Ghostdriver to allow a custom --remoteHost param all wrapped up in a Docker Container with configurable Environment Variables.
I hope this saves someone the lost weeks I suffered.
workaround*** d/l source from phantomjs http://phantomjs.org/build.html and edit hub_register.js in the src/ghostdriver comment out lines as shown below:
//var ghostdriver = ghostdriver || {};
return {
capabilities: [{
browserName: "phantomjs",
version: version,
//platform: ghostdriver.system.os.name + '-' + ghostdriver.system.os.version + '-' + ghostdriver.system.os.architecture,
maxInstances: 1,
seleniumProtocol: "WebDriver"
compile and everything works!
shortcut: https://github.com/darwin10/phantomjs
Original Source : https://github.com/detro/ghostdriver/issues/394
Try replacing localhost with local IP
phantomjs --webdriver=8090 --webdriver-selenium-grid-hub=http://localhost:4444
with
phantomjs --webdriver=8090 --webdriver-selenium-grid-hub=http://127.0.0.1:4444
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With