I'd wager it's working off keypress events.  Problem is we can't
easily fire those in watir because the .fire_event method only takes a
single parameter (the event) and I believe to work properly keypress
needs a parameter for the value of the key that was depressed.

You might need to write your own function that executes the javascript
fireevent function instead, similar to this item from Stackoverflow a
year or two ago    
http://stackoverflow.com/questions/602069/autocomplete-dropdown-test-with-ruby-watir

Another alternative is described here
http://zbarzone.blogspot.com/2008/08/watir-sendkeys-and-javascript.html
and that approach might actually be better for you.

To fix this 'for real' it seems we'd need to first modify .fire_event
to allow for a second parameter, or create a new method such
as .fire_key_event  that would take two parameters.  Then any other
methods that have keypress events in them such as .set would need to
be altered to fire the down/press/up events character by character and
fire those events with the proper 'key' values for each character.

On May 24, 11:24 am, Lisa Crispin <[email protected]> wrote:
> I tried the log events thing, it's nice to know about that, but I don't see
> anything that really looks like the JS firing. I see a lot of 'select',
> 'click' 'keydown', 'input', 'keypress', 'keyup', none of that looks like
> what the JS is doing with the type ahead.
> -- LIsa
>
> On Mon, May 23, 2011 at 2:36 PM, Željko Filipin <
>
>
>
>
>
>
>
>
>
> [email protected]> wrote:
> > On Mon, May 23, 2011 at 9:44 PM, Lisa Crispin <[email protected]>
> > wrote:
> > > We are changing what used to be regular drop-down select list boxes to a
> > dojo widget thingie that allows type ahead to select the item.
>
> > Is the page public? Or a similar page? Frameworks usually have examples
> > somewhere online.
>
> > If you think the only problem is that a JavaScript event is not fired (by
> > Watir), take a look at this:
>
> >http://stackoverflow.com/questions/3787555/how-to-find-out-which-java...
>
> > If the site is not public, but you could show it to me, contact me off
> > list.
>
> > Željko
> > --
> > watir.com - community manager
> > watir.com/book - author
> > watirpodcast.com - host
> > viaqa.mobi conference on software testing - organizer
>
> >  --
> > 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]
>
> --
> Lisa Crispin
> Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
> and Agile Teams_ (Addison-Wesley 2009)
> Contributor to _Beautiful Testing_ (O'Reilly 2009)http://lisacrispin.com
> @lisacrispin on Twitterhttp://entaggle.com/lisacrispin

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