PERL Win32::IEAutomation with Frames

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?

Thanks

LVL 1
A_Ridiculously_Long_Unique_NameAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bryan ButlerCommented:
Does a "nested" frame call work:

# Nested frames
$ie->getFrame("name:", "first_frame")->getFrame("name:", "nested_frame");
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
A_Ridiculously_Long_Unique_NameAuthor Commented:
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.

Thanks



0
A_Ridiculously_Long_Unique_NameAuthor Commented:
no solution has been found as yet.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.