[Webinar] Streamline your web hosting managementRegister Today


PERL Win32::IEAutomation with Frames

Posted on 2010-03-25
Medium Priority
Last Modified: 2012-05-09
Hi Exeperts,

I am working on a PERL script to automate the retrieval of information from a server which uses frames and post-backs (Using Win32::IEAutomation )

I am having a lot of difficulties addressing the desired control on the desired frame.

My understanding was that frames work in a hierarchy where a frame may contain one or more additional frames ad-infinitum.

I have created a simple collection of html files on my local HDD and can address the controls ok, using my PERL script, yet when I try to do it on the real web-server I get an error.

my $url = 'https://www.somesite.com';
my $mech->gotoURL( $url );

my $f1 = $mech->getFrame("name:", "Frame1");
$data = $f1->Content();
# works up to here
my $f2 = $f1->getFrame("name:", "Frame2");
#does not work
# Can't call method "Content" on an undefined value at 1.pl line 159.
$data = $f2->Content();

I have checked the $data and it contains the frame with the name Frame2, what is going wrong?

Why would it work with my simulated html and not on the web-server?


  • 2
LVL 16

Accepted Solution

Bryan Butler earned 2000 total points
ID: 28683646
Does a "nested" frame call work:

# Nested frames
$ie->getFrame("name:", "first_frame")->getFrame("name:", "nested_frame");
ID: 28717998
It works fine with my test data, but does not work on the production server.

I have found a workaround, which is to perform a get content on the first frame, then parse that content to find the src url of the second frame.

I then do a gotoURL directly to the second frame's url and I can reda the content.

So I have been able to get it working, albeit crudely. It messes up the browser because now the main window is just the content of what would have been in the second frame.

Some additional notes:
the frames' urls are .aspx and the server uses https and cookies.
My test data does not, my test data is a collection of very simple html files organised as frames.


ID: 33151530
no solution has been found as yet.

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

613 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question