Hello all,

I've been attempting to integrate my scripts using FireWatir and
Watir, and am having a difficult time with accessing global variables.
Here is a working script you can try:

Basically, the first variable file I'm using is this (startup.rb):
===================================
require 'watir'
Watir::Browser.default = 'firefox'
$ie = Watir::Browser.new
$site = "http://www.google.com";
$search_criteria = "goonies"

$ie.goto $site
===================================


Here is a second variable file I'm using: (global_controls.rb):
====================================
require 'watir'

$search_field = $ie.text_field(:name, "q")
$search = $ie.button(:name, "btnG")
$lucky = $ie.button(:name, "btnI")

$back_to_search = $ie.image(:src, "/images/nav_logo3.png")
====================================


The script file goes like this (search.rb):
====================================
require 'watir'
require 'startup'
require 'global_controls'

# run the search
$search_field.set $search_criteria
$search.click

# go back to the Google home page
$back_to_search.click

# attempt to run another search
$search_field.set "goonies 2"  # <--- ** This is where it isn't
working! **
$search.click # <-- ** This isn't working either... **

#end
====================================

It's when I attempt to go back to the home page and run another search
that nothing happens. I don't even get an error message. Clearly, I
must be doing something wrong. I also tried the attach method but no
dice.

Any help would be most appreciated, thanks!


--~--~---------~--~----~------------~-------~--~----~
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