Selenium server pre-running?



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',
   { 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' } })


The script works fine on my local machine with selenium-server running.


There is no mention of selenium server on the listings of software installed on the build images in the docs.

You can add it via circle.yml easily enough:

    - wget    2.44.0.jar
    - java -jar selenium-server-standalone-2.44.0.jar:
        background: true


Thanks, that’s what I ended up doing (with caching). I had to use phatomjs though because I couldn’t get chrome to work (it would just hang or tell me there was an error when connecting).

    - "~/cache"
    - mkdir -p ~/cache
    # only downloads if not already in cache
    - cd ~/cache && wget -nc
    - java -jar ~/cache/selenium-server-standalone-3.0.1.jar:
          background: true