Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.42k stars 435 forks source link

phantomjs-prebuilt doesn't work with webdriverio and local docker environment #650

Closed ishristov closed 7 years ago

ishristov commented 7 years ago

I have a similar code to the Running with Webdriver example working. Here what it looks like:

webdriverio.remote({desiredCapabilities: {browserName: 'phantomjs'}, logLevel: 'verbose'})
  .init()
  .url('https://developer.mozilla.org/en-US/')
  .waitForExist('h1', 10000)
  .getText('h1').then(function (text) {
    console.log(text)
  })

And this successfully logs the h1 from the mozilla site.

But when I change the url from https://developer.mozilla.org/en-US/ to https://docker.local:1234 nothing happens (getText timeouts because the content of the https://docker.local:1234 never actually loads). But I can open it in the browser and the site is there. We are using docker for that environment and I am running webdriverIO with selenium-standalone start and ./node_modules/.bin/babel-node ./test.js .

Is it because of docker or something else is at play?

P.S. It is working fine if I use "chrome" instead of "phantomjs" for the browserName.

nicks commented 7 years ago

This package is just an installer. If you're having problems with phantomjs you need to ask the fine folks at http://phantomjs.org/. My shot-in-the-dark guess is that you misconfigured you're using http and you screwed up your local SSL config, which is non-trivial to get right.