I'd ask about the bring to front thing in a new question.

On Nov 2, 6:14 pm, Joe Fleck <[email protected]> wrote:
> Hi Chuck,
>
> Thank you for the two suggestions.  I do use the watir-webdriver on my MAC.
>  I think I may have figure out the issue.  When I run the script and the
> firefox browser is running the back the click to the text_field does not
> active the buttons to display.  Although when I have the browser in focus
> (watching the browser) the click the text works perfectly and the text is
> entered and the buttons display.
>
> Is there a method that brings the browser to the front of all the other
> apps running on my mac?
>
> I am using the send_keys to enter the characters.
>
> Joe
>
> On Wed, Nov 2, 2011 at 6:50 PM, Chuck van der Linden <[email protected]>wrote:
>
>
>
>
>
>
>
> > 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 readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > [email protected]
> >http://groups.google.com/group/watir-general
> > [email protected]

-- 
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