A better way to start Selenium server

by Pete Houston

In order to get Codeception to work for acceptance testing, there requires to install and run Selenium server.

The common way is:

  • Visit the site and download the Selenium-server (v2.44.0).
  • Under command-line, issue the following command every time you need to use:
$ java -jar selenium-server-standalone-2.44.0.jar

Well, that part is pretty inconvenient, isn’t it?

There is a better way I’ve found, that is, to use the package selenium-standalone. Here how it works:

Download the package; additionally, I prefer to make it global in my system.

$ npm install -g selenium-standalone

and it starts with chrome and firefox. Pretty much handy!

I prefer this way, though in common way, you can create such an alias in the shell like:

$ alias selen-chrome=”java -jar path/to/selenium-server-standalone-2.44.0.jar -Dwebdriver.chrome.driver=/path/to/chrome-driver

Isn’t it better this way?

Have fun, then ☺

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.