Yes Sorry Chuck .. my mistake .. the input element is the target .. On Friday, 16 March 2012 14:07:29 UTC+11, Chuck van der Linden wrote: > > I could swear the html he posted said he was looking for an input tag. I > see the outer div container that holds it, and it's possible he may need to > manipulate that instead, but for the moment (lacking an example of this > jquery control to play with) I'm gonna take him at his word. > > But regarding that input element, it appears to be lacking the normal > 'type=' attribute that would control what type of input this is, so I'm not > sure what watir will make of it. For sure, lacking the type that would > define it as an text input field, the 'text_field' element is NOT going to > work. Watir has an input class, but I think it's used mostly as a common > parent for the more specific input types > (CheckBox<http://rubydoc.info/github/watir/watir-webdriver/Watir/CheckBox>, > FileField<http://rubydoc.info/github/watir/watir-webdriver/Watir/FileField>, > Hidden <http://rubydoc.info/github/watir/watir-webdriver/Watir/Hidden>, > Radio <http://rubydoc.info/github/watir/watir-webdriver/Watir/Radio>, > TextField<http://rubydoc.info/github/watir/watir-webdriver/Watir/TextField> > ), still it might work for this. > > I suppose it might be worth trying > > browser.input(:id => ''Submitted-From_txt").exists? in IRB and seeing > if it returns true or false > > > > > On Thursday, March 15, 2012 4:55:57 PM UTC-7, Anthony Hallett wrote: >> >> The element you are trying to find is: >> <DIV class="form-combo-filter required form- >> item" id="Submitted-From" name="SubmittedFrom" >> jQuery15105095347377816295="1"> ? >> >> firstly, as it has an id, and by convention this should be unique try: >> >> found = ie.div(:id => 'Submitted-From').present? >> >> found will be true if watir finds the element >> >> I noticed in your post you have id => 'Submitted-From_txt' which does not >> match the id in the HTML so watir may be correctly saying it can't find it >> >> I also see that you have some jQuery library javascripts happening so >> if the id's match & watir still cannot find it then you may have a timing >> issue. >> Have a look at >> https://github.com/watir/watir-webdriver/wiki/AJAX-and-waiting-for-elements >> >> >> hope this helps & happy testing :-) >> >> 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