in reply to Re: Cannot re-enter username, password into login form
in thread Cannot re-enter username, password into login form

I'm using WWW::Mechanize

Here is a snippet of code:
$mech->get($url); $mech->form_name('loginform'); $mech->set_fields(user_login => $username, user_pass => $password); $mech->click(); my $output_page = $mech->content(); if ($output_page =~ m/cookies/) { $TestStatus = 1; ok( $TestStatus , "Login failed - Browser not enabled to accept co +okies error"); # Try logging in again - should work this time... $mech->get($url); $mech->form_name('loginform'); $mech->set_fields(user_login => $username, user_pass => $password); $mech->click(); }

The first attempt fails and I get the cookies error, which tells me that I'm populating the user_login and user_pass fields. But after invoking the click method, I can't seem to repopulate the fields - at least that's how the site is behaving...

Replies are listed 'Best First'.
Re^3: Cannot re-enter username, password into login form
by Anonymous Monk on Aug 02, 2014 at 07:17 UTC