Does anyone know if the circle build environment comes with selenium server? I’m trying to run a Node.js script that uses the local selenium server but it fails with this error:
{ Error: Couldn't connect to selenium server
at end() - take-screenshots.js:40:8
message: 'Couldn\'t connect to selenium server',
type: 'RuntimeError',
seleniumStack:
{ status: -1,
type: 'ECONNREFUSED',
message: 'Couldn\'t connect to selenium server',
orgStatusMessage: 'Couldn\'t connect to selenium server' } }
The script looks like this:
const webdriverio = require('webdriverio')
const baseURL = 'http://localhost:5000'
const dir = process.env.CIRCLE_ARTIFACTS
const scr = str => dir + '/' + str
const u = str => baseURL + str
const client = webdriverio
.remote({ desiredCapabilities: { browserName: 'chrome' } })
.init()
client
.init()
.url(u('/'))
.saveScreenshot(scr('homepage.png'))
.end()
The script works fine on my local machine with selenium-server
running.