Skip to main content
Topic: Selenium: How does it work? (Read 3190 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Selenium: How does it work?

I noticed that Selenium is in the dev tree now. Can anyone tell me how it works? What do I need to install, what do I need to code? My boss asked me to evaluate it for our company.

Re: Selenium: How does it work?

Reply #1

We are using it to run functional browser tests with phpunit although I still can't get the code coverage reports to work.

For us its a very basic setup.  run selenium server (single .jar file) inside xvfb with firefox as the browser so a headless display setup.   PhpUnit has a selenium extension that we use as a webdriver, it sends the commands to selenium with in turn runs the browser (or browsers if you want).   You interact with Dom based syntax, byId, byName byCssSelector, click, move, etc ... and check results.   Right now its really just to test our controller interaction and results vs any true browser support.

You would not have to run it headless necessarily, or could export the display.  I'd expect you would probably use a grid setup with whatever browsers/os combo you support.  The biggest thing of course is writing all the test cases to run.

Re: Selenium: How does it work?

Reply #2

Well, we have two FreeBSD servers and a number of OSX clients; on the other project, it's an OSX server with the same clients.

Is there any good, ehm, tutorial for that? I'm stuck between even the different Selenium downloads.
(I hate unit tests.)
-

Re: Selenium: How does it work?

Reply #3

I'll poke around and see if I can find any good tutorials

On way to think about selenium is its a server, like say Apache in a way.  Its a java app, so on OSx you should just be able to download the latest server and do a
Code: [Select]
java -jar selenium-server-standalone-2.24.1.jar
and it should start and be running  ... then visit
Code: [Select]
http://127.0.0.1:4444/wd/hub/static/resource/hub.html
to see status and
Code: [Select]
 http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer
to turn it off.

On your *nix server you would do about the same thing, but headless or exported.  How you use it depends on what /how your testing / continuous integration is set up.  Jenkins is a popular CI choice when you have your own servers and it has a good interface to run selenium as well.  You could look for tutorials on Jenkins + Selenium or check on sauce labs.

 

Re: Selenium: How does it work?

Reply #4

We use Jenkins for our Java/C++ projects internally, so maybe this would work. Still it won't for our (my :D) PHP project, right?