Error: address not available when running WebDriver

selenium
firefox

#1

I am using WebDriver.io to run integration tests on both Chrome and Firefox in a circleci/node:6-browsers image.

These tests work fine locally. However, when I run them on CircleCI, only Chrome executes and passes. Firefox won’t start, with the following error:

ERROR: address not available
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: '153827abadcd', ip: '172.21.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-109-generic', java.version: '1.8.0_131'
Driver info: driver.version: unknown
remote stacktrace: stack backtrace:
   0:           0x4edb3c - backtrace::backtrace::trace::hc4bd56a2f176de7e
   […]

My wdio config is as follows (edited for brievety):

{
  specs: [ 'test/integration/suites/…' ],
  baseUrl: 'http://0.0.0.0:8080',
  capabilities: [
    { browserName: 'firefox' },
    { browserName: 'chrome' }
  ],
  services: ['selenium-standalone'],
 […]
}

I have the following dependencies in my package.json:

    "wdio-mocha-framework": "^0.5.12",
    "wdio-selenium-standalone-service": "0.0.10",
    "webdriverio": "^4.11.0",

Has anyone encountered a similar issue? Is there anything I am missing in terms of setting up the browser?


#2

Hi @MattiSG,

Having the same error. I am not using selenium-standalone service (so it’s neither in my wdio.conf.js nor my package.json) however, I manually started a selenium server in my circle CI config with the GeckoDriver like so:

    steps:
  - checkout

  # Download and cache dependencies
  - restore_cache:
      keys:
      - v1-dependencies-{{ checksum "package.json" }}
      # fallback to using the latest cache if no exact match is found
      - v1-dependencies-
  # No need to install dockerize as its already present
  - run:
      name: Create Selenium Log
      command: mkdir browser-test-reports
  - run:
      name: Download Selenium & Geckodriver
      command: |
        curl -O http://selenium-release.storage.googleapis.com/3.11/selenium-server-standalone-3.11.0.jar
        curl -L https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-linux64.tar.gz | tar xz
        chmod +x geckodriver
  - run: 
      name: Spinup Selenium Server and set Gecko Driver
      command: java -jar -Dwebdriver.gecko.driver=./geckodriver selenium-server-standalone-3.11.0.jar -log browser-test-reports/selenium.log -port 4444
      background: true
  - run:
      name: Wait for db
      command: dockerize -wait tcp://localhost:27017 -timeout 2s
  - run:
      name: Wait for redis cache
      command: dockerize -wait tcp://localhost:6379 -timeout 2s
 
  - run: npm install

  - save_cache:
      paths:
        - node_modules
      key: v1-dependencies-{{ checksum "package.json" }}
    
  # run tests!
  - run: npm test
  - run:
      name: Run e2e tests against browsers
      command: ./node_modules/.bin/wdio ./wdio.conf.js

  - store_artifacts:
      path: browser-test-reports/selenium.log

#3

Hi @MattiSG

I have discovered how to fix this problem. The issue is because of the older version of firefox (47) shipped with the browsers image. As shown on this thread, https://github.com/circleci/circleci-images/issues/86, this has caused errors for other people too. The way to resolve this error is to upgrade your firefox version as part of your config.yml. The instructions for how to do so are on the thread above but incase you can’t find them, here are the instructions I used:
`

run:

      name:  Install the latest firefox

      command: |
        sudo apt-get remove firefox-mozilla-build &&
        sudo sh -c "echo 'deb http://ftp.hr.debian.org/debian sid main' >> /etc/apt/sources.list" &&
        sudo apt-get update &&
        sudo apt-get remove binutils
        sudo apt-get install -t sid firefox &&
        firefox --version

`


#4

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.