try something like  frame = ie.frame(:id=>'fraMagnum')
                       text_box = 
frame.text_field( id=>"Submitted-From_txt")

(make sure you use :id not :name for the frame)

You may still run into problems as the input may not resolve as a textfield 
but if you can get the frame object, have a look at it's html for more 
clues ..

On Friday, 16 March 2012 03:13:29 UTC+11, srinivasarao jyothi wrote:
>
> Hi There, 
>
> I am new to ruby& watir. I have started learning recently. When i 
> tried to automate the following, watir is throwing error saying could 
> not locate.Please help me out on this. 
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Transitional//EN"><META http- 
> equiv="Content-Type" content="text/html; charset=utf-8"> <HTML><BODY 
> id="body_createbill" style="MIN-HEIGHT: 500px"><FORM id="form1"><DIV 
> class="form-container"><DIV class="form-combo-filter required form- 
> item" id="Submitted-From" name="SubmittedFrom" 
> jQuery15105095347377816295="1"> 
>
> -----i want to locate the following:--------------- 
> ============= 
> <INPUT class="form-control form-combo-text-control required ui- 
> autocomplete-input" id="Submitted-From_txt" autocomplete="off" 
> role="textbox" aria-autocomplete="list" aria-haspopup="true" 
> jQuery15105095347377816295="2" value="" /> 
> ============= 
> </DIV></DIV></FORM></BODY></HTML> 
>
>
> i tried: 
>
> ie.text_field(:class=>'form-control form-combo-text-control required 
> ui-autocomplete-input',:id=>'Submitted-From_txt') 
>
> and 
> ie.div(:class=>'form-control form-combo-text-control required ui- 
> autocomplete-input',:id=>'Submitted-From_txt') 
>
> both fired the error: 
>
> Watir::Exception::UnknownObjectException: Unable to locate element, 
> using {:clas 
> s=>"form-control form-combo-text-control required ui-autocomplete- 
> input", :id=>" 
> Submitted-From_txt"}

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

Reply via email to