Hi,
I'm using Win32::IEAutomation to crawl through an internal website which is full of javascript
The script runs fine... till it reaches a point where it has to open a new window for Search Option
If i use my existing agent to click and open the search window, then it opens the "Search" box in the already opened website window
This is fine, but upon trying to get some details, the website wants to open the details in the parent screen.
The parent screen no longer exists as it has been overridden...
If i create a new agent to open the Search window, it still is unable to find the parent screen...
How do i ensure communication between two windows (IE)...????
Sample Code: use Win32::IEAutomation; my $url = "http://xyz.com"; my $agent = Win32::IEAutomation->new(visible=>1); $agent->gotoURL($url); my $user ="USER"; my $pwd = "PWD"; $agent->getTextBox('name:','login')->SetValue($user); $agent->getTextBox('name:','password')->SetValue($pwd); $agent->getButton('name:',"Submit")->Click(); $agent->getFrame("name:","topFrame")->getImagee('alt:', "mgmt")->Click +; ###the below is the search popup### $url2 = "http://xyz.com/abc.html?from=Search"; ##now there are 2 options for me... ##One is to continue with the $agent that already exists.. ##another is to create a new one.. ## here, i continue with the new agent $agent2 = Win32::IEAutomation->new(visible=>1); $agent2->gotoURL($url2); $agent2->getSelectList('name:','typecombo')->SelectItem('Address'); $agent2->getTextBox('name:',"searchstring)->SetValue("SEARCH_STRING"); $response = $agent->getButton('name:','global_search')->Click(); ####Seems to work till here.. $agent2->getLink('linktext:',"Search_String")->Click(); ####Tries to find the parent window and gets stuck :( ####
Raghu

In reply to Win32::IEAutomation multiple windows problem by imrags

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.