Gui Unit testing with Ruby

A

Arti Singh

I am unable to access the methods defined in Selenium::Client::Idiomatic
under my unit tests which are a child of Test::Unit::TestCase

$browser=Selenium::SeleniumDriver.new("localhost", 4444, "*chrome", $url
, 10000);


Before I added tests into the Test::Unit::TestCase, I had been able to
use the $browser variable defined above to access all the methods under
the class Selenium.

Every time I try to run the unit tests, the tests fail at
$browser.element?(xpath to element location)with the error
NoMethodError: undefined method `element?' for
#<Selenium::SeleniumDriver:0x330ff7c>


I have no idea how to access the methods in the
Selenium::Client::Idiomatic or the other classes because without adding
CrudDContent as a child of Test::Unit::TestCase the entire suite runs

class CrudDContent<Test::Unit::TestCase
login("CROME")
def test_content()


sleep(2)
navtoolbar("Item")
sleep(2)
assets("Components")

waitforlocator($x_dynamicontent)
assert($browser.element?($x_dynamicontent))
end#def test_content()

end #class CrudDContent<Test::Unit::TestCase
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top