Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: WWW::Mechanize::Firefox popup window help

by Corion (Patriarch)
on May 13, 2012 at 17:45 UTC ( [id://970307]=note: print w/replies, xml ) Need Help??


in reply to WWW::Mechanize::Firefox popup window help

Most likely, you are getting the timeout error from clicking the popup window. See the WWW::Mechanize::Firefox documentation about the synchronize parameter to the ->get method. Also see WWW::Mechanize::Firefox::Troubleshooting for further explanation of the issue and the same resolution.

WWW::Mechanize::Firefox does not have convenient support for popup windows. You can initialize a secondary WWW::Mechanize::Firefox object by passing in the newly created window in the tab parameter to the constructor.

Replies are listed 'Best First'.
Re^2: WWW::Mechanize::Firefox popup window help
by mmittiga17 (Scribe) on May 16, 2012 at 15:09 UTC

    Thank you for your time and information. Working on this now.

      I'm having a similar problem that synchronize doesn't seem to solve. I'm trying to automate filling out some forms that get auto-populated by a popup. The popup fires off a js to autofill the previous form. If I use the popup as it's own URL i can access the "form1" just fine (but then it won't autofill the previous page with the js), but when I actually try to navigate using the below code, it can't find "form1".

      Any ideas?

      if($visitFound eq 0){ $oa_mech->get($addv_url); die unless ($oa_mech->success); sleep(2); #get patient ID $oa_mech->click({id => 'ctl00_phFolderContent_Button1', synchr +onize => 0}); for (1..10){ last if $oa_mech->is_visible( xpath => '//*[@id="ctl04_pop +upBase_btnSearch"]'); sleep(1); } $oa_form_name = "form1"; $oa_mech->form_name($oa_form_name); $oa_mech->set_fields( '#ctl04_popupBase_txtSearch' => 'Hester', '#ctl04_popupBase_DOB_Month' => $birthMonth, '#ctl04_popupBase_DOB_Day' => $birthDay, '#ctl04_popupBase_DOB_Year' => $birthYear, ); $oa_mech->click({id => 'ctl04_popupBase_btnSearch', synchroniz +e => 0}); for (1..10){ #wait for visit page to reload last if $oa_mech->is_visible( xpath => '//*[@id="ctl00_phF +olderContent_DateVisited_Year"]'); sleep(1); } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://970307]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-18 14:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found