13

I want to try running an Intern functional test (i.e. using webdriver) on a single browser, on the local machine. The doc says that I need a "Selenium 2 Server".

How do I setup the server exactly though? Do I need to download and install it separately from Intern? (If so, how?) And do I need to start it as a separate process, before calling "node runner.js"? (If so, how?)

Bill Keese
  • 1,792
  • 14
  • 29

3 Answers3

11

intern provides an easy way for you to have everything below the optional machine boundary in this diagram

selenium components

if you want to run a functional test with intern you don't need to have a local selenium server. saucelabs is one option that offers a cloud-based solution which is much less effort than setting up a local selenium server. there is a video capture of each test and you can also see the tests running live and interact with them if you need to. also, there are free accounts so you can ease your way into it without being committed. this is definitely the easiest way to start trying functional testing with intern.

if you really need to have a local server then yes you need to download it and install it separately from intern. all the pieces above the dotted optional machine boundary line are what you need to provide. http://docs.seleniumhq.org/docs/03_webdriver.jsp#running-standalone-selenium-server-for-use-with-remotedrivers seems to outline what you would need to do to get the selenium server setup but to be honest i haven't done it myself - i just use saucelabs because it's so simple and does everything i need it to do.

EDIT: I finally got around to setting up selenium locally. it was surprisingly easy - https://gist.github.com/neonstalwart/6630466

neonstalwart
  • 760
  • 3
  • 12
  • 1
    One note though, I have found it quite easy to use SauceLabs, the only challenge though is that you do have to have a way to reach the machine you are running the tests on, which can be challenging in some corporate environments. – Kitson May 07 '13 at 14:44
  • OK thanks, I will try http://docs.seleniumhq.org/docs/03_webdriver.jsp#running-standalone-selenium-server-for-use-with-remotedrivers. Saucelabs looks interesting, and has free usage for open source, although it seems awkward for development of tests in that IIUC the HTML page(s) you are driving need to be a public URL. – Bill Keese May 10 '13 at 01:47
  • 1
    you can use a tunnel so that your pages don't need to be public https://saucelabs.com/docs/connect. intern makes that part seamless for you, it sets up the tunnel when you start your tests. – neonstalwart May 10 '13 at 19:07
  • I hadn't realised that! I just assumed I had to open a port on my firewall. – Kitson May 13 '13 at 16:21
1

via the package installer:

download the jarfile for selenium server standalone at SeleniumHQ.org, run with:

java -jar path/to/jarfile

OR via Brew

brew install selenium-server-standalone
selenium-server

OR similar via macports

...BTW, you might also want to install the chromedriver:

brew install chromedriver
selenium-server -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver 
johntrandall
  • 194
  • 6
0

Since protractor came out this has become much easier. Protractor has a helper bin to help you do this:

npm install -g protractor
webdriver-manager update
webdriver-manager start

And now you have a server running.

Peter Ajtai
  • 56,972
  • 13
  • 121
  • 140