in reply to Re: using and debuging www Mechanize
in thread using and debuging www Mechanize

Thanx! So if my code looks like this
$mech->submit_form( form_number => 1, fields => { 'ctl00$ctl00$cphVeriCentre$cphLogin$txtUser' => 'someone', 'ctl00$ctl00$cphVeriCentre$cphLogin$txtPW' => 'pass', 'ctl00$ctl00$cphVeriCentre$cphLogin$ddlServers' => +'Live', }, ); die unless ($mech->success); $mech->dump_forms();
I should see the new page i got directed to after submitting the form?
Because i don't.
I also noticed there are two type="submit" parts in the source code, the second one is in another panel, can that cause a problem?

Thank you

Replies are listed 'Best First'.
Re^3: using and debuging www Mechanize
by Corion (Patriarch) on Jun 08, 2009 at 12:58 UTC

    HTML does not have "panel"s, so it's kinda hard to tell what you mean by this. If you're not ending up at the page you expect to, you'll need to debug that issue, possibly by looking at whether the HTML contains some error message or something.

    Mechanize will use the "submit" button associated with your form. Maybe take another look at what ->dump_forms() outputs.

      When i use ->dump_forms() after i ran the Submit_form i get:
      ctl00$ctl00$cphServer$cphLogin$txtUser=someone (text) ctl00$ctl00$cphServer$cphLogin$txtPW= (password) ctl00$ctl00$cphServer$cphLogin$ddlServers=Live (option) [*Live|Tes +t] ctl00$ctl00$cphServer$cphLogin$btnSignIn=Sign-In (submit) ctl00$ctl00$cphServer$cphLogin$btnConfigure=Configure (submit)
      And i see there are two Submit lines, how i can make sure submit_form is using the correct one?
        What is the correct one? 2nd example from SYNOPSIS
        $mech->submit_form( form_name => 'search', fields => { query => 'pot of gold', }, button => 'Search Now' );
        So try
        submit_form( button => 'Sign-In', ...