HTTP::Recorder Introducing HTTP::Recorder #14

Adding tests

You may want to add tests as you record.

If submitting the form returns these results:



We can test that the results are what we expected:

    sub fill_in_name {
      my $name = shift;

      $agent->form_name("form1");
      $agent->field("name", $name);
      $agent->submit_form(form_name => "form1");
    }

    my $entry = "Linda Julien";
    fill_in_name($entry);

    $agent->content =~ /You entered this name: (.*)/;
    is ($1, $entry);
Linda Julien