korimo / firewatir

Automatically exported from code.google.com/p/firewatir
0 stars 0 forks source link

FireFox - fire_event does not work for li when selecting an option from Jquery selectMenu #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Browser: FireFox 3.5.7, I have all the latest gems as of today.

1. We are using JQuery selectMenu as drop down boxes, to be able to select 
using Watir.

HTML Code for selectMenu
****************
<div class="standardSelects">
<div id="genderSelect" class="selectMenu">
<span class="title">
<a onclick="return false;" href="#">Select one</a>
</span>
<ul class="optionList" style="display: none;">
<li id="NotSet" class="selected">Select one</li>
<li id="M">Male</li>
<li id="F">Female</li>
</ul>
<input id="Gender" class="dropDownHiddenValue" type="hidden" 
value="NotSet" name="Gender"/>
<input id="GenderName" class="dropDownHiddenName" type="hidden" 
value="Select one" name="GenderName"/>
<span class="currentSelectionNumber hide">0</span>
</div>
</div>
********************
2.  I have code like this to handle it and it works fine for IE, but does 
not do any thing for Firefox.

browser.div(:id,"selectMenu").click #To open the control
browser.div(:id,"selectMenu").ul(:class,"optionList").li
(:id,'F').fire_event("onClick")

I tried li(:id,'f').click then firing the evnt on select menu and 
different things, I can see that watir is seeing the object alright, but 
some how the event is not triggered for firefox.

**I have simplified the code so that I can explain what I am doing

3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

HTML for Control with LIs is

<div class="standardSelects">
<div id="genderSelect" class="selectMenu">
<span class="title">
<a onclick="return false;" href="#">Select one</a>
</span>
<ul class="optionList" style="display: none;">
<li id="NotSet" class="selected">Select one</li>
<li id="M">Male</li>
<li id="F">Female</li>
</ul>
<input id="Gender" class="dropDownHiddenValue" type="hidden" 
value="NotSet" name="Gender"/>
<input id="GenderName" class="dropDownHiddenName" type="hidden" 
value="Select one" name="GenderName"/>
<span class="currentSelectionNumber hide">0</span>
</div>
</div>

Original issue reported on code.google.com by jvoot...@gmail.com on 14 Jan 2010 at 8:02

GoogleCodeExporter commented 9 years ago
browser.div(:id,"selectMenu").ul(:class,"optionList").li
(:id,'F').fire_event("onClick")

change onClick to onclick becoz <a onclick="return false;" href="#">Select 
one</a>
</span>

so try this 

browser.div(:id,"selectMenu").ul(:class,"optionList").li
(:id,'F').fire_event("onclick")

Original comment by rajivkum...@gmail.com on 17 Sep 2010 at 2:18