Sorry to email you about this issue, I asked the question in Watir
discussion group but with no help or replies at all.
how do I select li link with id from a jquery dynamic list. Can this be done
in watir??
Using Watir 2.0, Ruby 1.8.7:
require "rubygems"
require "watir"
require "firewatir"
ie=Watir::IE.new
I have a dynamic Div that contains
<div id="industry" class="modal">
<dl id="SomeID" class="first">
<dt>someText</dt>
<dd>
<ul>
<li id="someID1">
<a href="#" class="selected">someText</a>
<li id="someID2">
<a href="#">SomeText</a>
This list is in a modal "jquery pop up form". So I want to click on
any <li>. and after I click on the link, another set of <li>'s will
appear, that I need to select from as well. So my problem is how to
select the li even though they are not in the page, because they are
dynamically generated by the server based on the user click. Also do I
need to wait for it to load. I am a Watir newbie so please the more
detail the better.
Here is my current code:
#this will launch the jquery form successfully
ie.link(:id, "launchIndustry").click_no_wait
#this is the <dl> that contain all the <li>'s
ie.wait_until {ie.div.dl(:id, "container_dl").exists? }
puts ie.div.dl(:id, 'container_dl').exists? # good up to here
ie.wait_until {ie.div.li(:id, "firstLink").exists? }
ie.div(:id => "industry").li(:id => "firstLink").click
The error that I get is:
timed out after 60 seconds, which means that the script can't the
first li element. Please help, because I have to select these options
before I can move forward as it's a required field.
Any help is appreciated.
Thanks
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]