[RndTbl] trouble with Firewatir

Dan Martin ummar143 at shaw.ca
Tue Apr 20 12:05:48 CDT 2010


As noted in the previous email
 >> browser.frame("main")
=> #<FireWatir::Frame:0x1a90dd4 located=false how=:name what="main">

"located=false" seems to be Firewatir's way of saying that the object  
doesn't exist until I ask for it.
If I try to use it anyway, I get an unknown object exception

 >> browser.frame("main").html
Watir::Exception::UnknownObjectException: Unable to locate element,  
using :name, "main"
	from /Library/Ruby/Gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ 
element.rb:907:in `assert_exists'
	from /Library/Ruby/Gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ 
elements/frame.rb:34:in `html'
	from (irb):62

On 20-Apr-10, at 11:34 AM, Sean Walberg wrote:

>
> Looking at the rdocs, http://wtr.rubyforge.org/rdoc/1.6.5/, have you  
> tried
>
> browser.frame("main").html
>
> ?
>
> On Tue, Apr 20, 2010 at 10:51 AM, Dan Martin <ummar143 at shaw.ca> wrote:
> I am learning to navigate and scrape.  I have had more success with
> Firewatir than Ruby mechanize, but both are poorly documented.
>
> Current problem:  logging into a site webpage, Firwatir can see the
> frames, but cannot access them.
>
>  >> browser.show_frames
> There are 3 frames
> frame: name: topbar
>       index: 1
> frame: name: langFrame
>       index: 2
> frame: name: main
>       index: 3
> => 0..2
>
>  >> browser.frame(:index, 1)
> => #<FireWatir::Frame:0x1a9260c located=false how=:index what=1>
>
>  >> browser.frame("main")
> => #<FireWatir::Frame:0x1a90dd4 located=false how=:name what="main">
>
> Firefox shows the webpage source [I show only the top levels]
> structure as:
>
> <html>
>
> <head>
>        <meta http-equiv="content-type" content="text/ 
> html;charset=iso-8859-1">
>        <title>TITLE</title>
>        <link rel="stylesheet" href="all.css">
>
>        <script language="JavaScript" src="WEBPAGE"></script>
>        <script language="JavaScript">FUNCTIONS</script>
> </head>
>
>        <frameset rows="63,0,*" border="0" id="frameset_ID"  
> framespacing="0"
> frameborder="no" onload="loadHomepage(1);" onunload="forceLogout();">
>                <frame src="/TDM/header.htm" name="topbar"  
> scrolling="no"
> noresize>STUFF IN HERE</frame>
>
>                <frame name="langFrame" src="lang.html">STUFF IN  
> HERE</frame>
>                <frame src="" id="main_ID" name="main" noresize>STUFF  
> IN HERE THAT I
> WANT</frame>
>        </frameset>
>
>        <noframes>
>                STUFF IN HERE
>        </noframes>
>
> </html>
>
>
> I cannot access any forms etc included in the frame unless I can
> name / access the frame.
> Any ideas?
>
> Dan Martin
> GP Hospital Practitioner
> Computer Scientist
> ummar143 at shaw.ca
> (204) 831-1746
> answering machine always on
>
> _______________________________________________
> Roundtable mailing list
> Roundtable at muug.mb.ca
> http://www.muug.mb.ca/mailman/listinfo/roundtable
>
>
>
> -- 
> Sean Walberg <sean at ertw.com>    http://ertw.com/
> _______________________________________________
> Roundtable mailing list
> Roundtable at muug.mb.ca
> http://www.muug.mb.ca/mailman/listinfo/roundtable

Dan Martin
GP Hospital Practitioner
Computer Scientist
ummar143 at shaw.ca
(204) 831-1746
answering machine always on

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.muug.mb.ca/pipermail/roundtable/attachments/20100420/6a3e8912/attachment.html 


More information about the Roundtable mailing list