Mulitbrowser selenium ruby


#1

Hope all is well,

Striaght to the point I wonder if someone has any ideas to help me with
the following problem:

I have written an automation framework in ruby, that uses selenium and
rspec and is run by an ant task, as thats the build process that is
implemented here.

Im currently running all my spec tests in firefox on my local machine by
passing the selenium variable:

@selenium = Selenium::SeleniumDriver.new(“localhost”, 4444, “*chrome”,
“#{URL_BASE_1}”, 10000);

if i want to change it to use ie then i would do the following
@selenium = Selenium::SeleniumDriver.new(“localhost”, 4444, “*iehta”,
“#{URL_BASE_1}”, 10000);

This is fine, bu i want to modify the run so it runs the tests against
all the browsers in one go without having to manually edit that line
after each run.

Anyone have any ideas on how i can do this using rspec?


#2

Togetherne Togetherne wrote:

Anyone have any ideas on how i can do this using rspec?

We run Integration tests across multi browsers simultaneously using
Selenium Grid. Perhaps you could use that (I believe it comes with ant
tasks that do some of the magic).

http://selenium-grid.openqa.org/

Alternatively if you just want to run them sequentially why don’t you
write a simple wrapper script. Something like:

%w{iehta chrome}.each |browser| do
@selenium = Selenium::SeleniumDriver.new(“localhost”, 4444,
“*#{browser}”,"#{URL_BASE_1}", 10000);

#go rspec go!

spec --format html spec/

@selenium.stop
end

A further note, it does seem a bit odd to have specs that touch Selenium
if thats what you are doing. Perhaps look towards using Features and
something like Cucumber
http://github.com/aslakhellesoy/cucumber/tree/master rather than specs.

HTH

Joseph W.
http://www.joesniff.co.uk


#3

Joseph W. wrote:

We run Integration tests across multi browsers simultaneously using
Selenium Grid. Perhaps you could use that (I believe it comes with ant
tasks that do some of the magic).

Thanks Joseph i looked at selenium grid and it seems to be the answer to
all my problems!! thank you so much!! wondering if you could give me a
hand to set it up so that it drives multiple drivers…

I have downloaded the demo, and run the example ruby tests in sequence
and parrallel.

I know how to start the hub, how to set up different RC instances that
support different browsers on different machines but…

im still unsure on how to get it to run all the tests in ie and firefox
without having to manually chaning it everytime…can you shed some
light??

Thanks appreciate the help you have given me so far…