Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
29
rated 0 times [  34] [ 5]  / answers: 1 / hits: 168656  / 14 Years ago, fri, september 24, 2010, 12:00:00

I have a select list:



<select id=filter>
<option value=Open selected=selected>Open</option>
<option value=Closed>Closed</option>
</select>


When I select Closed the page reloads. In this case it shows closed tickets (instead of opened). It works fine when I do it manually.



The problem is that the page does not reload when I select Closed with Watir:



browser.select_list(:id => filter).select Closed


That usually means that some JavaScript event is not fired. I can fire events with Watir:



browser.select_list(:id => filter).fire_event onclick


but I need to know which event to fire.



Is there a way to find out which events are defined for an element?


More From » events

 Answers
18

Looks like Firebug (Firefox add-on) has the answer:




  • open Firebug

  • right click the element in HTML tab

  • click Log Events

  • enable Console tab

  • click Persist in Console tab (otherwise Console tab will clear after the page is reloaded)

  • select Closed (manually)

  • there will be something like this in Console tab:



    ...
    mousemove clientX=1097, clientY=292
    popupshowing
    mousedown clientX=1097, clientY=292
    focus
    mouseup clientX=1097, clientY=292
    click clientX=1097, clientY=292
    mousemove clientX=1096, clientY=293
    ...



Source: Firebug Tip: Log Events


[#95509] Wednesday, September 22, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
isaacvalentinn

Total Points: 325
Total Questions: 120
Total Answers: 131

Location: North Korea
Member since Tue, Jun 16, 2020
4 Years ago
;