I added the patch for watir.rb to the jira ticket Paul
----- Original Message ----- From: "Paul Rogers" <[EMAIL PROTECTED]> To: <wtr-general@rubyforge.org> Sent: Tuesday, May 29, 2007 6:04 PM Subject: Re: [Wtr-general] maxLength Validation >I opened jira 157 and added a patch for the unit test and html > I'll try and take a look at the set method itself later on > > ----- Original Message ----- > From: Bret Pettichord <[EMAIL PROTECTED]> > Date: Tuesday, May 29, 2007 11:30 am > Subject: Re: [Wtr-general] maxLength Validation > >> Fletch wrote: >> > I have been looking for a solution to this problem, and was >> wondering if anyone could give me some advice. >> > I noticed yesterday that WATIR did not pay any attention to the >> maxLength of the text_field. >> > >> > I have tried using name.set("abc") and name.value = "abc" but >> both are still going over the allowed limit. >> > >> > The solution that I have come up with (and it is not a good >> solution) is to truncate the name. >> > >> > nameSize = name.size >> > maxSize = frame.text_field(:name, 'Name').maxLength >> > if (vinSize > maxSize) >> > puts("Bigger than maxLength - #{vinSize} -- #{maxSize}") >> > name = name[0, maxSize] >> > end >> > >> > This does the job in so far as the maxLength limits are >> observed, but is there a better solution to the problem? >> > >> > >> This has been a frequently mentioned problem. I think we should >> consider >> it a defect in Watir. Please go ahead and open a Jira ticket on >> it, and >> we can go ahead and fix it. >> >> The TextField#set method should limit to max length automatically. >> >> Bret >> _______________________________________________ >> 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 > _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general