On 8/15/06, Astha Raj <[EMAIL PROTECTED]> wrote: > What I need do to > only look for the string which ends with the given section. For example, I > have two form fields with id like > > FormName_Name1 and FormName_Name1New > > So when I use the Watir statement like – > e.text_field(:id,/_Name1/).set("astharaj") – it will put the same in both – > right? I want it to just set for first field (FormName_Name1). How can I do > this? Any suggestions would be great.
Use the \A and \Z anchors to match the beginning and end of strings, respectively. I believe the answer to your question is e.text_field(:id, /_Name1\Z/).set("astharaj") _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general