ruby - How to click Dropdown list -


<div id="ab100">     <iframe width="1000" height="600" src="...">     <!doctype html>     <html xmlns="http://www.w3.org/1999/xhtml">     <head>     <body>     <form id="form1" action=".." method="post">         <select id="abl03" style="..">..\',\'\')', 0)" name="l03ue">                 <option value="0" selected="selected"><select value></option>                 <option value="1">ab</option>                 <option value="2">ad</option>                 <option value="3">bc</option>                 <option value="4">ca</option>             </select>         </div> 

when want click on ddl, this:

browser.select_list(:id => 'ab103').select('ca') 

and select option value = "4". getting error:

watir::exception::unknownobjectexception: unable locate element, using {:id=> "abl03", :tag_name=>"select"}         c:/ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir -webdriver/elements/element.rb:490:in `assert_exists' 

maybe problem due in iframe. in advance.

a few things:

  1. there no opening <select> tag in example. i'm assuming <div id="abl03"> should <select id="abl03"> or it's missing.
  2. the id <select id="abl03"> abl03, id locator value in select_list(:id => 'ab103') ab103.
  3. <select value> in <option value="0" selected="selected"><select value></option> should &lt;select value&gt;.

so, unable locate elementerror valid because <select> tag specified id not exist.

if run issues frames, check out http://watirwebdriver.com/frames/ , https://github.com/watir/watirspec/blob/master/frame_spec.rb examples.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -