# Set up values to be tested ... $mech->field( $name => $value ); ... my ($value, $type) = $mech->eval_in_page('validateIpSettings()'); is($value, 'some expected value');