Running Selenium server in ubuntu

Submitted by code_admin on Mon, 07/30/2018 - 13:11

I had to follow these steps to get the Selenium server running on my ubuntu development machine:

  1. sudo npm install -g selenium-standalone
  2. sudo selenium-standalone install

I found I needed a program called xvfb-run to run chrome in a virtual X enviroment

  1. sudo apt install xvfb

Command to start selenium server with chrome driver is:

  1. xvfb-run java -Dwebdriver.chrome.driver=/usr/local/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.33-x64-chromedriver -jar /usr/local/lib/node_modules/selenium-standalone/.selenium/selenium-server/3.7.1-server.jar

I made a shortcut to this sel in my bin

  1. #!/bin/bash
  2. #Start selenium server with chrome driver extension
  3.  
  4. if [[ "${EUID}" -eq 0 ]];
  5. then
  6.   echo "Please do not run as root"
  7.   exit
  8. fi
  9.  
  10. xvfb-run java -Dwebdriver.chrome.driver=/usr/local/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.33-x64-chromedriver -jar /usr/local/lib/node_modules/selenium-standalone/.selenium/selenium-server/3.7.1-server.jar
  11.  
  12.  
  13. ##xvfb-run java -Dwebdriver.chrome.driver=/usr/local/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.33-x64-chromedriver -jar /usr/local/lib/node_modules/selenium-standalone/.selenium/selenium-server/3.7.1-server.jar -debug

I was trying to get the following tests working:
http://codecept.io/quickstart/

RJM Article Type
Quick Reference