On Tue, Mar 31, 2009 at 13:46, Vikas Tulashyam <vtulash...@gmail.com> wrote:
> I am creating a some common methods and
> for that I have created some classes and I want to work on the same
> IE instance, means all the classes should access the same IE instance
> and perform the operations on the same IE. I have written the classes
> in separate Ruby files.

There are several ways of solving the problem:

1) use global variable for browser, like $browser, and all your scripts will
have access to it
2) send variable that points to browser to method as parameter:

def do_something(browser)
  browser.goto "google.com"
end

browser = Watir:IE.new
do_something(browser)

There are more solutions, but this two look the simplest to me.

Željko

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to