you may have to fire more than one mouse event. i once had to fire an onmousedown, wait 1 sec, then fire onclick (or something like that, i don't quite remember). try doing it interactively with irb instead of writing the test and running over and over. playing with it interactively sometimes makes it much faster to develop a solution to an unusual situation.
On Mar 17, 9:30 am, tester86 <[email protected]> wrote: > Hi > ( > I did try text_field before but it does not work, after I set focus > and execute text_field(:index, 2).set("Test") error stating index 2 > has been disabled. What I am doing: I set the focus in the drop down, > then set onblur(if i do $b.select_list(:value, "Test").click this > clicks on the default value in the drop down) however the list is > invisible checked using firebug. I need to somehow click on the drop > down again in order to display the list. I have tried various > combinations but nothing working. I have triggered fire_events. > > Thanks > > On Mar 16, 10:55 pm, Mrunal <[email protected]> wrote: > > > Hi > > > In case when there is drop down arrow, the elements are set using > > text_field sometimes. > > Please try this option also. > > > e.g. $ie.text_field(:name,'').set('') > > > tester86 wrote: > > > Hi > > > > I did fire a javascript event that will set the focus in the drop down > > > list: > > > > $b.table(:index, 1)[2][6].fire_event("onmousedown") > > > > When the above line is executed it does not display the drop but it is > > > focused. When I do either of the following: > > > > $b.select_list(:index, 2).select("Test") > > > $b.select_list(:index, 2).set("Test") > > > > It does not select the link. I have to somehow click on the drop down > > > arrow again in order to populate the drop down list. This is the same > > > behavior when selecting a value in the drop down list manually. > > > > Thanks > > > > On Mar 15, 5:29 pm, Tiffany Fodor <[email protected]> wrote: > > > >> Hi! > > > >> You have a typo in your select statement: > > > >> $b.select_list(:index, 2).select_list("Test") > > > >> should be: > > > >> $b.select_list(:index, 2).select("Test") (although, I think > > >> $b.select_list(:index, 2).set("Test") should work as well) > > > >> Have you tried firing your javascript to put focus on the field just > > >> before attempting the select statement? > > > >> Hope this helps! > > > >> -Tiffany > > > >> On Mar 15, 2:43 pm, tester86 <[email protected]> wrote: > > > >>> I need to click on a drop down. I have a script that will set the > > >>> focus in the drop down list then when I go to select the value it does > > >>> not select the list. Manually: When I click in the drop down field it > > >>> gets activated then when I click on the drop down arrow it will > > >>> display the list. > > > >>> Interaction: > > > >>> When I click in the cell it sets the focus, then I have to click on > > >>> the drop down arrow in order to see the list of options. If I do: > > > >>> $b.table(:index, 1)[2][6].fire_event("onmousedown") > > > >>> The above will set the focus in the field that contains the drop down. > > >>> Manually I have click on the drop down in order to see the list > > > >>> If I do: > > > >>> $b.select_list(:index, 2).select_list("Test") > > > >>> It does not click on Test. Is there any way I can click on the drop > > >>> down in order to see the list.. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: [email protected] To unsubscribe: [email protected]
