Hi,
  I have created two classes and i am calling methods from one class to
another. Look into the following classes


#---------------------Class1--------------------------#
require "Practicals3.rb"
require "test/unit"
require "rubygems"
gem "selenium-client"
require "selenium/client"

 class Untitled < Test::Unit::TestCase
  def test_untitled2
  t = Login.new
  t.test_openbrowser(1,2)
  t.initialstep(1,2)
  t.Booking(1,2)
#---------------------

  @selenium.click "css=span.bold.decornone"
#----------------------

  t.closebrowser(1,2)
  end

end

#---------------------------Class2----------------------#
require "test/unit"
require "rubygems"
gem "selenium-client"
require "selenium/client"
  class Login
attr_reader :a, :b

    def test_openbrowser(a,b)
      @verification_errors = []
    @selenium = Selenium::Client::Driver.new \
      :host => "localhost",
      :port => 4444,
      :browser => "*chrome",
      :url => "http://demo.jeluk.com/",
      :timeout_in_second => 60

    @selenium.start_new_browser_session
    end

  def initialstep(a,b)

    puts a
    puts b

    @selenium.open ""
    @selenium.type "id=login", "demo.harish"
    @selenium.type "id=password", "123456789"
    @selenium.click "name=commit"
    @selenium.wait_for_page_to_load "30000"

  end

  def Booking(a,b)
    @selenium.select "id=searchbus_to", "label=Hyderabad"
    @selenium.click "name=commit"
    @selenium.set_speed "3000"
    @selenium.click "css=img[alt=\"Book\"]"

  end

    def closebrowser(a,b)
    @selenium.close_current_browser_session
    end

  end
------------------------------------------------------
In the class1 i am writing the step as @selenium.click
"css=span.bold.decornone
so, when i execute the script it is showing the following error
"NoMethodError: undefined method `click' for nil:NilClass"

The step "@selenium.click "css=span.bold.decornone" in class1 is
dependent on the method test_openbrowser in class2. And i dont want to
open the new browser session.

Please suggest me the solution

-- 
Posted via http://www.ruby-forum.com/.