I would suggest something like this.  I suspect you're running into a 
race/timing issue where the make select list exists, but it hasn't been 
populated with the expected values yet.

Watir::Wait.until { b.select_list(:id, "MainContent_drpMake").include?(
"ACURA") }
b.select_list(:id, "MainContent_drpMake").select("ACURA")

Dan

On Saturday, March 9, 2013 2:55:12 AM UTC-5, abr.n...@gmail.com wrote:
>
> Design of the Apps:
>
> First Dropdown:  (All Loads Dynamically)
>
> -------------------
> <select id="MainContent_drpVehicleType" style="width:175px;" 
> name="ctl00$MainContent$drpVehicleType">
> <option value="">- SELECT -</option>
> <option value="1" title="AUTO">AUTO</option>
> <option value="2" title="HD">HD</option>
> <option value="3" title="MARINE">MARINE</option>
> </select>
>
> Second Dropdown:
> -----------------------
>
> <option value="">-SELECT-</option>
> <option value="1" title="ACURA">ACURA</option>
> <option value="2" title="ALFA ROMEO">ALFA ROMEO</option>
> <option value="74" title="ALLIS CHALMERS LIFT TRUCK">ALLIS CHALMERS LIFT 
> TRUCK</option>
> <option value="75" title="ALLIS CHALMERS TRACTOR">ALLIS CHALMERS 
> TRACTOR</option>
> <option value="4" title="AMERICAN MOTORS">AMERICAN MOTORS</option
>
>
> Code used for execution:
> -----------------------
> b.select_list(:id, "MainContent_drpVehicleType").select("AUTO")
>
>
> b.select_list(:id, "MainContent_drpMake").select("ACURA")
> What my Problem is able to select "AUTO" from first dropdown
> and not able to select "ACURA"  from second dropdown
>  
> Error in Execution:(Wat in see in Command Prompt)
> ==========================
>  
>
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-webdriver/el
> ements/select.rb:218:in `no_value_found': "ACURA" not found in select list 
> (Wati
> r::Exception::NoValueFoundException)
>         from 
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir
> -webdriver/elements/select.rb:152:in `rescue in select_by_string'
>         from 
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir
> -webdriver/elements/select.rb:149:in `select_by_string'
>         from 
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir
> -webdriver/elements/select.rb:131:in `select_by'
>         from 
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir
> -webdriver/elements/select.rb:64:in `select'
>         from C:/Ruby193/menu.rb:23:in `<main>'
>  
>  
>
> Kindly Anyone fix this issue
>
> Thanks in Advance:
> Ragu
>
>  
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to