PDA

View Full Version : Solved: Getting the handle of a frame



kbsudhir
07-02-2008, 06:56 AM
Hello all,

I have created macros which login to the website serach for the desired info using a keyword (In my case I use the PO# as a keyword to search the relevant data on that PO)

But in one of the website on which I am working now, has two frames whcih are called dynamically. I have to click a link in the left hand side frame which will then diplay the search tool in the right hand side frame.

There are no frame names as such.

My problem is how to get a handle of these frames so that I can access the objects & links on these frames.

The webpage is coded in Javascript

Below is the webpage source which is calling those frames

// construct dynamic frameset
document.write( "<FRAMESET ROWS=\"80, *\" BORDER=\"0\" FRAMEBORDER=\"0\" FRAMESPACING=\"0\">" );
document.write( "<FRAME NAME=\"Mast\" src=\"/gpiec/blue.html\" scrolling=\"no\">" );
document.write( "</FRAME>" );
document.write( "<FRAMESET COLS=\"180,6,*\" BORDER=\"0\" FRAMEBORDER=\"0\" FRAMESPACING=\"0\" onload=\"top.WorkArea.ProcessTarget()\">" );
document.write( "<FRAME NAME=\"NavSide\" src=\"/gpiec/blue.html\">" );
document.write( "</FRAME>" );
document.write( "<FRAME name=\"blank\" src=\"/gpiec/blank.html\" scrolling=\"no\">" );
document.write( "</FRAME>" );
document.write( "<FRAME NAME=\"WorkArea\" SRC=\"/cgi-bin/ncommerce/ExecMacro/gpi_welcome.d2w/report?langcode=" + cookieHash[ "pcom_langcode" ] + "\">" );
document.write( "</FRAME>" );
document.write( "</FRAMESET>" );
document.write( "</FRAMESET>" );

Any guidance on this is appreciated.

stanl
07-03-2008, 05:40 PM
have you tried

fr1 = document.getElementsByTagName
("FRAME").item(0)

fr2 = document.getElementsByTagName
("FRAME").item(1)

Stan

kbsudhir
07-07-2008, 04:45 AM
No Stan,

I will try this out & let you know.

Thanks
Sudhir

kbsudhir
07-07-2008, 10:58 AM
Thanks Stan,

Its working.

Thank you very much for your help.

:bow: :bow:
Sudhir