[wtr-general] Re: Need help, trying to develop tests for a dojo filtering select widget.

2011-02-03 Thread swares
Forgot some information.

Running a fully patched English version of Windows XP Pro with IE
8.0.6001.18702.

Spent a long time trying to figure this out, from the posts I reviewed
it looks like what I have should work, so not sure where to go from
here.

Running these in irb by hand to work out the sequence.  another issue
is send_keys seemed to send the keystroke to the irb window instead of
the browser window.

On Feb 1, 2:54 pm, swares swa...@us.ibm.com wrote:
 Trying to develop watir tests for an app using dojo, need to test a
 dijit Filtering Select widget.
 Was able to get part of this figured out but cannot figure out how to
 trigger some events.
 Trying to simulate the use of a selection widget via keyboard and
 mouse interaction.

 The selection list is in a div - ul - li format, and the widget
 consists of a number of components so the normal
 watir select methods do not work.

 Usedhttp://www.java2s.com/Tutorial/JavaScriptDemo/dijitformFilteringSelec...
 as an example for these widgit tests, not getting any errors but not
 getting the expected results either (ie. cmd runs but nothing apparent
 happens).  I didn't include all the ways I tried to do this just the
 way I though was most likely to work.

 1) After setting a value, I need to fire a keypress event to cause the
 popup to appear.
 Then I want to hit enter to finalize the select.

 2) After popping open the select widget and highlighting an entry, I
 need to select it.

 watir (1.7.1)
 ruby 1.9.2p136 (2010-12-25) [i386-mingw32]

 require 'watir'
 Watir::Browser.default  = 'ie'
 b = Watir::Browser.new;
 b.goto 'http://www.java2s.com/Tutorial/JavaScriptDemo/
 dijitformFilteringSelect.htm'
 b.text_field(:class = 'dijitReset').focus()

 # first method of selecting option via text input
 b.text_field(:class = 'dijitReset').set '1'
 b.div(:id =
 'widget_dijit_form_FilteringSelect_0').fire_event('onkeyup') # not
 triggering widget
 b.send_keys('{ENTER}') # did not trigger widget

 # Second method of selecting option via mouse input
 b.div(:class = 'dijitArrowButtonInner').fire_event('onmousedown')
 b.ul(:id = 'dijit_form_FilteringSelect_0_popup').li(:text =
 '11').fire_event('onmouseover')
 b.ul(:id = 'dijit_form_FilteringSelect_0_popup').li(:text =
 '11').click # did not trigger widget

 Thanks for your help,
 Scott Wares

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


[wtr-general] Re: Need help, trying to develop tests for a dojo filtering select widget.

2011-02-03 Thread swares
I have looked at it with IE Developer Toolbar and Firebug to see where
the events appeared to be attached.  Selected the elements for
inspection in IE but could not inspect the actual menu options using
that method as it performed a select.  In Firefox, after opening the
select, when I click so I can select elements for inspection the
select closes and I can't reopen the dialog with the inspection tool.

The code you provided did work to set this value w/o causing the
widgets validation routines show a error in the actual code I'm trying
to test.  When I tried to set the value directly into the text field,
it would throw validation errors after switching to another field
caused the validation function to run.  So that helps me with one part
of the problem.

Still, setting a partial value (as if typing) and firing this does not
trigger the select dropdown showing the items that match the input,
the bigger problem along with selection from that list via kb/mouse.

As far as watching the events, I did watch a session where I (manually
and via watir) used the widget and watched the detected events in
firebug but did not find enlightenment, it could be that I have not
used these browser tools that extensively.


On Feb 3, 8:38 am, Basim Baassiri ba...@baassiri.ca wrote:
 Have you tried tools like firebug to inspect the events to listen to and the
 html

 I was able to set the filtercombobox with the following code
 Does this work for you?

 input_id = dijit_form_FilteringSelect_0
 input_event = onkeypress
 b.text_field(:id = input_id).set '11'
 b.text_field(:id = input_id).fire_event input_event

 On Thu, Feb 3, 2011 at 9:44 AM, swares swa...@us.ibm.com wrote:
  Forgot some information.

  Running a fully patched English version of Windows XP Pro with IE
  8.0.6001.18702.

  Spent a long time trying to figure this out, from the posts I reviewed
  it looks like what I have should work, so not sure where to go from
  here.

  Running these in irb by hand to work out the sequence.  another issue
  is send_keys seemed to send the keystroke to the irb window instead of
  the browser window.

  On Feb 1, 2:54 pm, swares swa...@us.ibm.com wrote:
   Trying to develop watir tests for an app using dojo, need to test a
   dijit Filtering Select widget.
   Was able to get part of this figured out but cannot figure out how to
   trigger some events.
   Trying to simulate the use of a selection widget via keyboard and
   mouse interaction.

   The selection list is in a div - ul - li format, and the widget
   consists of a number of components so the normal
   watir select methods do not work.

   Usedhttp://
 www.java2s.com/Tutorial/JavaScriptDemo/dijitformFilteringSelec...
   as an example for these widgit tests, not getting any errors but not
   getting the expected results either (ie. cmd runs but nothing apparent
   happens).  I didn't include all the ways I tried to do this just the
   way I though was most likely to work.

   1) After setting a value, I need to fire a keypress event to cause the
   popup to appear.
   Then I want to hit enter to finalize the select.

   2) After popping open the select widget and highlighting an entry, I
   need to select it.

   watir (1.7.1)
   ruby 1.9.2p136 (2010-12-25) [i386-mingw32]

   require 'watir'
   Watir::Browser.default  = 'ie'
   b = Watir::Browser.new;
   b.goto 'http://www.java2s.com/Tutorial/JavaScriptDemo/
   dijitformFilteringSelect.htm'
   b.text_field(:class = 'dijitReset').focus()

   # first method of selecting option via text input
   b.text_field(:class = 'dijitReset').set '1'
   b.div(:id =
   'widget_dijit_form_FilteringSelect_0').fire_event('onkeyup') # not
   triggering widget
   b.send_keys('{ENTER}') # did not trigger widget

   # Second method of selecting option via mouse input
   b.div(:class = 'dijitArrowButtonInner').fire_event('onmousedown')
   b.ul(:id = 'dijit_form_FilteringSelect_0_popup').li(:text =
   '11').fire_event('onmouseover')
   b.ul(:id = 'dijit_form_FilteringSelect_0_popup').li(:text =
   '11').click # did not trigger widget

   Thanks for your help,
   Scott Wares

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

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