If you RTSL a bit you&#39;ll see that calling browser.frame creates a new element but doesn&#39;t validate it actually found anything. When you call the html method it first asserts that the object exists and throws an exception if not.<div>
<br></div><div>The located=false comes from the element#inspect method, (which just taught me a new Ruby idiom: !!@o returns true if @o is a valid object or false if it isn&#39;t.) So located=false means that the object never existed, nor will it ever.</div>
<div><br></div><div>While poking around I saw a locate_frame method. Maybe that might work better? (It&#39;s actually possible that .frame uses locate_frame, I didn&#39;t trace it far enough)</div><div><br></div><div>Failing that, what about opening the frame directly?</div>
<div><br></div><div>Sean</div><div><br></div><div><br><br><div class="gmail_quote">On Tue, Apr 20, 2010 at 12:05 PM, Dan Martin <span dir="ltr">&lt;<a href="mailto:ummar143@shaw.ca">ummar143@shaw.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">As noted in the previous email<div><div class="im"><div>&gt;&gt; browser.frame(&quot;main&quot;)</div>
<div>=&gt; #&lt;FireWatir::Frame:0x1a90dd4 located=false how=:name what=&quot;main&quot;&gt;</div><div><br></div></div><div>&quot;located=false&quot; seems to be Firewatir&#39;s way of saying that the object doesn&#39;t exist until I ask for it.</div>
<div>If I try to use it anyway, I get an unknown object exception</div><div><br></div><div><div>&gt;&gt; browser.frame(&quot;main&quot;).html</div><div>Watir::Exception::UnknownObjectException: Unable to locate element, using :name, &quot;main&quot;</div>
<div><span style="white-space:pre">        </span>from /Library/Ruby/Gems/1.8/gems/firewatir-1.6.5/lib/firewatir/element.rb:907:in `assert_exists&#39;</div><div><span style="white-space:pre">        </span>from /Library/Ruby/Gems/1.8/gems/firewatir-1.6.5/lib/firewatir/elements/frame.rb:34:in `html&#39;</div>
<div><span style="white-space:pre">        </span>from (irb):62</div><div><br></div></div><div><div></div><div class="h5"><div><div>On 20-Apr-10, at 11:34 AM, Sean Walberg wrote:</div><br><blockquote type="cite"><div><br></div>Looking at the rdocs, <a href="http://wtr.rubyforge.org/rdoc/1.6.5/" target="_blank">http://wtr.rubyforge.org/rdoc/1.6.5/</a>, have you tried<div>
<br></div><div>browser.frame(&quot;main&quot;).html</div><div><br></div><div> ?<br><br><div class="gmail_quote">On Tue, Apr 20, 2010 at 10:51 AM, Dan Martin <span dir="ltr">&lt;<a href="mailto:ummar143@shaw.ca" target="_blank">ummar143@shaw.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I am learning to navigate and scrape.  I have had more success with<br> Firewatir than Ruby mechanize, but both are poorly documented.<br>
 <br> Current problem:  logging into a site webpage, Firwatir can see the<br> frames, but cannot access them.<br> <br>  &gt;&gt; browser.show_frames<br> There are 3 frames<br> frame: name: topbar<br>       index: 1<br> frame: name: langFrame<br>
       index: 2<br> frame: name: main<br>       index: 3<br> =&gt; 0..2<br> <br>  &gt;&gt; browser.frame(:index, 1)<br> =&gt; #&lt;FireWatir::Frame:0x1a9260c located=false how=:index what=1&gt;<br> <br>  &gt;&gt; browser.frame(&quot;main&quot;)<br>
 =&gt; #&lt;FireWatir::Frame:0x1a90dd4 located=false how=:name what=&quot;main&quot;&gt;<br> <br> Firefox shows the webpage source [I show only the top levels]<br> structure as:<br> <br> &lt;html&gt;<br> <br> &lt;head&gt;<br>
        &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html;charset=iso-8859-1&quot;&gt;<br>        &lt;title&gt;TITLE&lt;/title&gt;<br>        &lt;link rel=&quot;stylesheet&quot; href=&quot;all.css&quot;&gt;<br>
 <br>        &lt;script language=&quot;JavaScript&quot; src=&quot;WEBPAGE&quot;&gt;&lt;/script&gt;<br>        &lt;script language=&quot;JavaScript&quot;&gt;FUNCTIONS&lt;/script&gt;<br> &lt;/head&gt;<br> <br>        &lt;frameset rows=&quot;63,0,*&quot; border=&quot;0&quot; id=&quot;frameset_ID&quot; framespacing=&quot;0&quot;<br>
 frameborder=&quot;no&quot; onload=&quot;loadHomepage(1);&quot; onunload=&quot;forceLogout();&quot;&gt;<br>                &lt;frame src=&quot;/TDM/header.htm&quot; name=&quot;topbar&quot; scrolling=&quot;no&quot;<br> noresize&gt;STUFF IN HERE&lt;/frame&gt;<br>
 <br>                &lt;frame name=&quot;langFrame&quot; src=&quot;lang.html&quot;&gt;STUFF IN HERE&lt;/frame&gt;<br>                &lt;frame src=&quot;&quot; id=&quot;main_ID&quot; name=&quot;main&quot; noresize&gt;STUFF IN HERE THAT I<br>
 WANT&lt;/frame&gt;<br>        &lt;/frameset&gt;<br> <br>        &lt;noframes&gt;<br>                STUFF IN HERE<br>        &lt;/noframes&gt;<br> <br> &lt;/html&gt;<br> <br> <br> I cannot access any forms etc included in the frame unless I can<br>
 name / access the frame.<br> Any ideas?<br> <br> Dan Martin<br> GP Hospital Practitioner<br> Computer Scientist<br> <a href="mailto:ummar143@shaw.ca" target="_blank">ummar143@shaw.ca</a><br> (204) 831-1746<br> answering machine always on<br>
 <br> _______________________________________________<br> Roundtable mailing list<br> <a href="mailto:Roundtable@muug.mb.ca" target="_blank">Roundtable@muug.mb.ca</a><br> <a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
 </blockquote></div><br><br clear="all"><br>-- <br>Sean Walberg &lt;<a href="mailto:sean@ertw.com" target="_blank">sean@ertw.com</a>&gt;    <a href="http://ertw.com/" target="_blank">http://ertw.com/</a><br> </div> _______________________________________________<br>
Roundtable mailing list<br><a href="mailto:Roundtable@muug.mb.ca" target="_blank">Roundtable@muug.mb.ca</a><br><a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
</blockquote></div><br><div> <span style="font-size:12px"><div style="word-wrap:break-word"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<div>Dan Martin</div><div><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">GP Hospital Practitioner</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
Computer Scientist</div><div><a href="mailto:ummar143@shaw.ca" target="_blank">ummar143@shaw.ca</a></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">(204) 831-1746</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
answering machine always on</div></div></div></div></div></div></span></div></span> </div><br></div></div></div></div><br>_______________________________________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.mb.ca">Roundtable@muug.mb.ca</a><br>
<a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Sean Walberg &lt;<a href="mailto:sean@ertw.com">sean@ertw.com</a>&gt;    <a href="http://ertw.com/">http://ertw.com/</a><br>
</div>