Running Selenium and Nightwatch tests

selenium
ui-test

#1

I’m trying to run Selenium and Nightwatch tests with our CircleCI/Git integration. Does anyone have any solutions that might help?

It seems as though Selenium is not starting correctly. I have tried with Nightwatch start_process: true/false, each gives a slightly different error regarding not being able to connect to Selenium:

start_process: false:

$nightwatch --group mobile --env stage
Starting selenium server... started - PID:  23236

[Mobile / Mobile] Test Suite
================================
Good day...

Running:  Mobile nav

Error retrieving a new session from the selenium server

Error writing log file to: /home/ubuntu/repo/tests/log/selenium-debug.log

Connection refused! Is selenium server started?
{ state: 'unknown error',
  sessionId: null,
  hCode: 1617093869,
  value: 
   { localizedMessage: null,
     cause: null,
     suppressed: [],
     message: null,
     hCode: 270607726,
     class: 'java.util.concurrent.TimeoutException',
     screen: null },
  class: 'org.openqa.selenium.remote.Response',
  status: 13 }

nightwatch --group mobile --env stage returned exit code 1

start_process: true:

$nightwatch --group mobile --env stage

[Mobile / Mobile] Test Suite
================================
Good day...

Running:  Mobile nav

Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ [Error: connect ECONNREFUSED 127.0.0.1:4444]
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 4444 }


nightwatch --group mobile --env stage returned exit code 1

circle.yml:

dependencies:
  pre:
  # Install Selenium.
  - curl https://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.1.jar > selenium-server-standalone.jar
  - curl https://chromedriver.storage.googleapis.com/2.28/chromedriver_linux64.zip | gzip -dc > chromedriver
  - chmod +x chromedriver
  - 'java -jar selenium-server-standalone.jar -trustAllSSLCertificates -Dwebdriver.chrome.driver=chromedriver':
        background: true
  # Update Google Chrome.
  - google-chrome --version
  - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
  - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb stable main" >> /etc/apt/sources.list.d/google.list'
  - sudo apt-get update
  - sudo apt-get --only-upgrade install google-chrome-stable
  - google-chrome --version
  # Install Nightwatch
  - npm install -g nightwatch
  - nightwatch --version
## Customize test commands
test:
  override:
    # use Nightwatch for testing
    - nightwatch --group mobile --env stage

#2

Have you installed Java? It seems is not executing the Selenium Server jar file because it doesn’t find java installed.


#3

Did you solve it?
I have the same issues.


#4