On Nov 2, 1:50 pm, Joe Fleck <[email protected]> wrote:
> Hi Chuck,
>
> I have tried a wait and it works sometime and others times it doesn't.
>
> Actually the html I provide is just section within the list that has the
> text field and button stuff.  I really don't need the
> 'li(:id,'add-new-comment').' which I will be removing soon.
>
> I create a random string of characters using the following:
>
> v = rand(125)
>
>                 rt = ""
>
>                 for tr in 0..v
>
>                   #get character value
>                   th_pick = (rand(26)+97).chr
>
>                   #place in a string
>                   rt << "#{th_pick},"
>
>                 end # End #Loop selecting random characters
>
>                 puts rt
>
> I think when I go to set the field with the long string the click event is
> lost and the buttons disappear.  I think if I type each individual
> character one at time which keeps watir and the field constantly
> interacting.  How can I do that since  the 'set' method over write the
> previous character?  I know QTP has a type method is there one for Watir?
>

Two suggestions

1) you might give watir-webdriver a try, the way it sends stuff is
just a little different, and I've found for some things (like for
example a searchbox with 'match as you type' feature) that it works
better.  It also gets your cross browser support, so you can test on
FF and Chrome.

2) Consider using .send_keys.   Note that this works a bit differently
in Watir-webdriver.  In Watir it works at the browser level, so you
may need to click or do something specific to set the focus to a given
area, otherwise it may type into the URL field of the browser itself.
In Watir-Webdriver it can be used at the element level  e.g.
browser.text_field(:how, what).send_keys

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to