You should use "ctl00_ContentPlaceHolder1_ddlSelectSupervisor" as the id for the select, not the id of the label....
On Apr 6, 12:09 pm, Angrez Singh <[email protected]> wrote: > you are trying to access select_list using id of label. I think watir is > right in not recognizing the element. Correct? > > ie.select_list(:id, "ct100_ContentPlaceHolder1_IbISupervisor"). > > "ct100_ContentPlaceHolder1_IbISupervisor" is ID for span & not select_list. > As per your HTML code "ctl00_ContentPlaceHolder1_ddlSelectSupervisor" is ID > for select list so you should try > > ie.select_list(:id, "ctl00_ContentPlaceHolder1_ddlSelectSupervisor") > > - Angrez > > On Mon, Apr 6, 2009 at 3:26 PM, spike <[email protected]> wrote: > > > hello sir > > > I used ur solution but its not working i'm getting the following error > > > irb(main):011:0> ie.select_list(:id, > > "ct100_ContentPlaceHolder1_IbISupervisor"). > > set("Select") > > Watir::Exception::UnknownObjectException: Unable to locate element, > > using :id, " > > ct100_ContentPlaceHolder1_IbISupervisor" > > from D:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > element.rb:52: > > in `assert_exists' > > from D:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > input_elements > > .rb:63:in `select_item_in_select_list' > > from D:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > input_elements > > .rb:47:in `set' > > > On Apr 6, 11:35 am, spike <[email protected]> wrote: > > > Hi > > > > The following is the code written for a check list. > > > > <td class="cellLabel"><div id="ctl00_ContentPlaceHolder1_Div7" > > > align="right"> > > > <span id="ctl00_ContentPlaceHolder1_lblSupervisor" > > > class="dataentrylabelsStyle">Supervisor :</span></div></td><td > > > class="cellInput"><select > > > name="ctl00$ContentPlaceHolder1$ddlSelectSupervisor" > > > id="ctl00_ContentPlaceHolder1_ddlSelectSupervisor" > > > class="stylenormalTextbox"> > > > <option > > value="--Select--">--Select--</option> > > > <option > > value="learner2">learner2</option> > > > <option > > value="learner1">learner1</option> > > > <option > > value="learner3">learner3</option> > > > <option > > value="user2">user2</option> > > > <option > > value="vinay">vinay</option> > > > <option > > value="user3">user3</option> > > > <option > > value="vinay1">vinay1</option> > > > <option > > value="user_1">user_1</option> > > > > Now if i'm writing the command > > > irb(main):021:0> ie.select_list(:id, > > > "ct100_ContentPlaceHolder1_IbISupervisor"). > > > set("vinay") > > > > I'm getting the following error > > > > Watir::Exception::UnknownObjectException: Unable to locate element, > > > using :id, " > > > ct100_ContentPlaceHolder1_IbISupervisor" > > > from D:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > > element.rb:52: > > > in `assert_exists' > > > from D:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > > input_elements > > > .rb:63:in `select_item_in_select_list' > > > from D:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > > input_elements > > > .rb:47:in `set' > > > > please suggest some solution we user .net technology for developing > > > website. > > > > thankingyou --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---
