I misunderstood the question. I like Rand's answer.

On 6/28/06, Rand Thacker <[EMAIL PROTECTED]> wrote:
ie.text_field(:name,"grade_result_list[#{x}].beanCount").set("800")

should do the trick.  Hope that helps

On 6/28/06, Legarreta, Frank < [EMAIL PROTECTED]> wrote:

When I hardcode an array to a set value it works: ie. "grade_result_list[1].beanCount" (where 1 is the array value).

However, I have an unknown number of rows, and when I try to increment the array value (see below) it does not work.

 

#####################################################################################

#purpose: there are 5 columns in a grid and a variable number of rows. I want to set the first column

# called "beanCount" to a specific value (in this case 800) for each row in the array.

#####################################################################################

 

rows = ie.text_fields.length / 5

 

for x in 1..rows do

ie.text_field(:name,"grade_result_list[x].beanCount").set("800")

end

 

#####################################################################################

 

Unfortunately, this results in the following error:

 

Watir::Exception::UnknownObjectException: Unable to locate object, using name an

d grade_result_list[x].beanCount

from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists'

from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3382:in `set'

from (irb):63

from ♥:0

 

Thank you,

Frank

"This e-mail and any attachments may contain confidential and privileged information. Any dissemination or use of the information by a person other than the intended recipient is unauthorized and may be illegal. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Although this e-mail and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the Board of Trade of the City of New York, Inc. or the New York Clearing Corporation for any loss or damage arising in any way from its use. Thank you."
 


_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general




--
"I am the most humble person in the world!"

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to