Gui Unit testing with Ruby

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs