[Wtr-general] How to use for loop in watir script?

Michael Bolton mb at michaelbolton.net
Thu Aug 10 11:13:25 EDT 2006


>My requirement is that, I want to print some text in 5 times in one text
box like "User name". I want to do with for loops but I'm not able do that.
Give me suggestion if you have any sense about that

require 'watir'
include Watir
ie = IE.start("http://www.google.ca")
the_field = ie.text_field(:index, 1)
message = "Please ask nicely next time " * 5
the_field.set(message)

---Michael B.




More information about the Wtr-general mailing list