# Using methods from Selenium::Client::Idiomatic in Unit::Test

**URL:** <https://www.ruby-forum.com/t/using-methods-from-selenium-idiomatic-in-unit-test/197012>\
**Category:** Ruby\
**Created:** [October 26, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/using-methods-from-selenium-idiomatic-in-unit-test/197012 "2009-10-26T19:24:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arti\_singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@arti\_singh](https://www.ruby-forum.com/u/arti_singh)\
**Post date:** [October 26, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/using-methods-from-selenium-idiomatic-in-unit-test/197012/1 "2009-10-26T19:24:46Z")

</div>

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
