From: Gaurang Shah Date: 2011-07-31T21:56:24+09:00 Subject: Re: NoMethodError: undefined method Y. Nobuoka wrote in post #1013959: > Hi, > > Do you initialize the instance variable @browser? > I think you need to call the method BaseClass.setup. > > Please retry after rewriting the following code > >> def test_login() >> username_textbox.set("Gaurang") >> password_textbox.set("gaurang") >> login_button.click() >> end > > into > > def test_login() > setup() # Add this line > username_textbox.set("Gaurang") > password_textbox.set("gaurang") > login_button.click() > end > > > Regards, actually the some of method is of unit test and gets invoked automatically. And sorry, as i have put the wrong code. the code is something like this.. require 'rubygems' require 'LoginPage' gem 'test-unit' require 'test/unit' require 'BaseClass' class LoginTest < Test::Unit::TestCase extend BaseClassClass include LoginPage def test_third() puts "third" username_textbox.set("gaurang") end end I am not including the BaseClass rather I am extending it. -- Posted via http://www.ruby-forum.com/.