I am writing some Web tests and am using WWW::Mechanize to emulate a browser. All went well until I encountered a rather bizarre form.
$webtest->submit_form( form_name => 'lookup', fields => { title => $some_title, }); is($webtest->title, 'Film Lookup Results', 'The Film Lookup title +should be correct'); like($webtest->content, qr/Usual Suspects, The/, '... and have som +e valid content');
As it turns out, the search works by redirecting the user to the results page, rather than simply returning the results. Thus, my title and content tests fail as the webtest is not automatically following the redirect. I tried using the WWW::Mechanize::redirect_ok() method, but I can't figure it out from the docs. They don't make it clear that a request object is a necessary argument. I also was wondering if I need to just grab the URI from the headers and just go there directly, but I've not tried that yet. Any suggestions?
Cheers,
Ovid
New address of my CGI Course.
In reply to Redirecting Forms with WWW::Mechanize by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |