From: eric tabora Date: 2006-05-26T05:41:31+09:00 Subject: Re: Multiple Arrays eric tabora wrote: > Justin Collins wrote: >> Justin Collins wrote: >>> Hi Eric, >>> more descriptive names, too. >>>> $ie.textField(:name, "height").set("#{size_array2}") >>> "height").set("#{size_array2[index]}") >>> >>> >>> -Justin >>> >> >> Oops - height_array2 => height_array. >> >> -Justin > > I think that I'm going to try the route of using one array instead of > two. My new array looks something like: > > size_array = [ 6x9, 5x7, 8.5x11 ] > > Is there some way that I can tokenize the array values to populate my > text fields: > > $ie.textField(:name, "width").set("#{size_array}") > > $ie.textField(:name, "height").set("#{size_array2}") I answered my own question. How does this look? def size_entry size_array = IO.readlines("OneOffSizes.txt") size_array.each_with_index do |size, index| size = size.split('x') $ie.textField(:name, "SearchCreativeMaterialsPortletInstance{actionForm.desiredSizeHorizontal}").set("#{size[0]}") $ie.textField(:name, "SearchCreativeMaterialsPortletInstance{actionForm.desiredSizeVertical}").set("#{size[1]}") $ie.button(:value, "Search").click sleep(1) #assert_size end end #size_entry -- Posted via http://www.ruby-forum.com/.