Im sure there is code in the set method to limit it to the max size - did it 
somehow get broken?

Paul

----- 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
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
> 
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to