Problem with Selenium RC with Rails

Hi

I recorded some tests using selenium ide and every one test works fine
and play entirely.

I installed the selenium-rails, selenium-ruby-client gems and
selenium-server jar files. I followed the instructions for export tests
recorded from selenium ide (in Ruby Selenium RC option) . So when I run
the test:selenium_with_servers_started rake task, my test starts well
and execute some commands for a while and after it crash abruptally

In ruby stack error this message allways appears : "
SeleniumCommandError: Timed out after 22000ms" (or another number
whatever)

In the selenium server log the related error occurs with this message:

Got result: Timed out after 22000ms on session
6b2e6b2187054d7e9497ac941e0760f1
11:33:02.194 INFO - Command request: testComplete[, ] on session
6b2e6b2187054d7e9497ac941e0760f1
11:33:02.194 INFO - Killing Firefox…
11:33:02.211 INFO - Got result: OK on session
6b2e6b2187054d7e9497ac941e0760f1
11:36:23.271 INFO - Shutting down…
11:36:23.272 INFO - Stopping Acceptor
ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,l

My test code look like this (under test/selenium ror path):

require “test/unit”
require “rubygems”
require “selenium”

class MyTestClass < Test::Unit::TestCase
def setup
@verification_errors = []
if $selenium
@selenium = $selenium
else
@selenium = Selenium::SeleniumDriver.new(
“localhost”,
4444,
“*firefox”,
http://mysite/”,
30 )
@selenium.start
end
@selenium.set_context(“test_task”)
end

def teardown
@selenium.stop unless $selenium
assert_equal [], @verification_errors
end

def test_task

@selenium.open "http://mysite/login/"
@selenium.wait_for_page_to_load "2000"
@selenium.type "user_nome", "someone"
@selenium.type "user_password", "abc"
@selenium.click "//input[@value=' Login ']"
@selenium.wait_for_page_to_load "30000"
@selenium.open "http://mysite/person/req/"
@selenium.type "re", "000"
@selenium.click "commit"
@selenium.wait_for_page_to_load "30000"
@selenium.wait_for_page_to_load "10000"
@selenium.select "sis_id", "label=1 - one system"
@selenium.click "//option[@value='3']"
@selenium.wait_for_page_to_load "22000"   #error
@selenium.click "link=Copy Tasks"
@selenium.wait_for_page_to_load "22000"

Doesn’t matter if I change the milliseconds or ad more commands
@selenium.wait_for_page_to_load “x”.
This error always repeat in the same or another point of this test
excution.

I believed that run selenium ide recorded tests with selenium RC + Rails
should be more simple
and I feel very frustrated with this issue.

If anyone can help me I thanks so much. I still hope in selenium RC for
automate my tests tasks and
I can provide more information if is necessary.

Thanks do much and I apologise for my bad English.

Bruno M…

Hi
Your code is missing something. Try this one

require “test/unit”
require “rubygems”
require “selenium”

class MyTestClass < Test::Unit::TestCase
def setup
@verification_errors = []
@selenium = Selenium::Client::Driver.new(
“localhost”,
4444,
“*firefox”,
http://tutorialspoint.com/”,
30 )
@selenium.start
end
def teardown
@selenium.stop unless $selenium
assert_equal [], @verification_errors
end

def test_task

@selenium.open "/ruby/ruby_hashes.htm"
@selenium.click "link=Ruby Date & Time"
@selenium.wait_for_page_to_load "30000"
@selenium.type "q", "module"
@selenium.click "//input[@name='sitesearch' and 

@value=‘www.tutorialspoint.com’]"
@selenium.click “sa”
@selenium.click “link=Ruby Ranges”
@selenium.wait_for_page_to_load “30000”
@selenium.click “link=Ruby Iterators”
@selenium.wait_for_page_to_load “30000”
end
end

It is working fine in my system.