Hi Lisa, what's the code for selectPlanAdvisor(); Do? Might be worth just eval'ing that ...
Regards, Tim Sent from my mobile ... On 28/05/2011, at 6:05 AM, Lisa Crispin <lisa.cris...@gmail.com> wrote: > (re-sending, I don't think it got sent for some reason) > > Now I am able to type text into the hidden field, but after looking at the > links Chuck recommended, the code from Paul, and lots of other Googling > around, I'm still flummoxed on trying to get the event to fire. > > Here is the html: > <select dojoType="dijit.form.FilteringSelect" id='advisorId' > name='advisorId' onchange="javascript:selectPlanAdvisor();"> > <option value="0" selected > > No Advisor > </option> > <option value="3785" > > FERNANDEZ, KEVIN S > </option> > </select> > > Here is what I've tried to try to fire the event: > ie.hidden(:id, 'advisorId').fire_event("onchange") > > This returns a value of "yellow" in irb (WTF?) but does not fire the JS. > > One of the Java developers here tried to help, but he's as baffled as I am. > Any other suggestions? I will have many scripts broken because of this, and I > depend on those scripts to help with our exploratory testing as well as > testing releases to the staging environment. I don't want to lose them! > > thanks, > Lisa > > > On Thu, May 26, 2011 at 1:44 AM, Chuck van der Linden <sqa...@gmail.com> > wrote: > 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 <lisa.cris...@gmail.com> 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 < > > > > > > > > > > > > > > > > > > > > zeljko.fili...@wa-research.ch> wrote: > > > On Mon, May 23, 2011 at 9:44 PM, Lisa Crispin <lisa.cris...@gmail.com> > > > 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. > > > > > watir-general@googlegroups.com > > >http://groups.google.com/group/watir-general > > > watir-general+unsubscr...@googlegroups.com > > > > -- > > 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. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com > > > > -- > 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 Twitter > http://entaggle.com/lisacrispin > > > > > -- > 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 Twitter > http://entaggle.com/lisacrispin > > -- > Before posting, please read http://watir.com/support. In short: search before > you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com