Your loop is 0-9 which is 10, your arrays are only 9 items long. You've overshot it by one.

for x in 0..8 do
.......

-Charley

On 7/19/06, Cain, Mark <[EMAIL PROTECTED]> wrote:
You will need to these:

require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
require 'watir/testcase'

I usually add the setup.rb from the unittest directory instead because
these requires are already in it.

--Mark

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] ] On Behalf Of mi
Sent: Tuesday, July 18, 2006 4:23 PM
To: [email protected]
Subject: [Wtr-general] for loop syntax??

Hi all,

I'm using a for loop to access arrays to fill  all the text fields in my

forms.  For some reason, i'm getting the following error at the end of
the for loop execution???
c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable
to locate object, using name and
(Watir::Exception::UnknownObjectException)
    from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3382:in `set'
    from c:/ruby/lib/ruby/site_ruby/1.8/watir/watir_simple.rb:402:in
`fill_text_field'
    from SmokeTest.rb :25
    from SmokeTest.rb:24


Thanks in advance!

<<<<<my code....>>

require 'watir'   # the watir controller\
require 'watir/watir_simple'
include Watir
include Watir::Simple

Simple1 = Simple

test_site = 'http://dev01.pheedo.com'
pubInfoTextFields =  ['user', 'email', 'password', 'repass', 'url',
'ssn', 'payment_address', 'payment_city', 'payment_zip']
pubInfo =  ['pubUserName', '[EMAIL PROTECTED]', '1', '1',
'http://www.test.com', '1234', '123 st', 'some city', '97035']
#[user name, emaildAdd, passwd1, passwd2, yourSite, TaxID, StreetAdd,
CityName, State, ZipCode]

Simple1.new_browser_at(test_site)
Simple1.click_link_with_text("Sign up now")  #same as
Simple::click_link_with_text("Sign up now")

#click on Publisher's sign up page
Simple1.click_link_with_url(test_site+"/register.phdo?mode=publish")

#Enter all the required fields
x=0
for x in 0..9 do
  Simple1.fill_text_field(pubInfoTextFields[x], pubInfo[x])
  puts "pubInfoTextFields = "+pubInfoTextFields[x]+"   pubInfo =
"+pubInfo[x]
end

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to