use Test::More qw(no_plan); use WWW::Mechanize; use HTTP::Request::Common; my $url = 'http://starting.url/'; my $a = WWW::Mechanize->new(); isa_ok( $a, "WWW::Mechanize" ) or die; $a->get( $url ); is( $a->status, 200, 'Fetched OK' ); my $form = $a->form_name('details'); ok($form, 'Details form'); my $action = $form->action(); # build a request object my $request = HTTP::Request::Common::POST($action, [ a_radio_button => 'invalid_value', ]); # Add any cookies into the request object $a->cookie_jar->add_cookie_header( $request ); # make the request $a->request( $request ); is( $a->status, 200, 'Fetched OK' );