--- HTTP/Recorder/Logger.pm 2006-01-08 14:35:01.000000000 -0600
+++ ../for_diff/HTTP/Recorder/Logger.pm 2006-06-21 13:17:43.000000000 -0500
@@ -90,7 +90,12 @@
@_
);
- $self->Log("get", "'$args{url}'");
+ $self->Log(
+ "get",
+ "'$args{url}'",
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
sub FollowLink {
@@ -103,14 +108,26 @@
if ($args{text}) {
$args{text} =~ s/"/\\"/g;
- $self->Log("follow_link",
- "text => '$args{text}', n => '$args{index}'");
+ $self->Log(
+ "follow_link",
+ "text => '$args{text}', n => '$args{index}'",
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
} elsif ($args{url}) {
- $self->Log("follow_link",
- "url => '$args{url}'");
+ $self->Log(
+ "follow_link",
+ "url => '$args{url}'",
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
} else {
- $self->Log("follow_link",
- "n => '$args{index}'");
+ $self->Log(
+ "follow_link",
+ "n => '$args{index}'",
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
}
@@ -123,26 +140,46 @@
button_name => {},
button_value => {},
button_number => {},
+ frame => '',
+ target => '',
@_
);
- $self->SetForm(name => $args{name}, number => $args{number});
+ $self->SetForm(
+ 'name' => $args{'name'},
+ 'number' => $args{'number'},
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
my %fields = %{$args{'fields'}};
+
foreach my $field (keys %fields) {
if ($fields{$field}{'type'} eq 'checkbox') {
- $self->Check(name => $fields{$field}{'name'},
- value => $fields{$field}{'value'});
+ $self->Check(
+ 'name' => $fields{$field}{'name'},
+ 'value' => $fields{$field}{'value'},
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
} else {
- $self->SetField(name => $fields{$field}{'name'},
- value => $fields{$field}{'value'});
+ $self->SetField(
+ 'name' => $fields{$field}{'name'},
+ 'value' => $fields{$field}{'value'},
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
}
+
# use click instead of submit
- $self->Click(name => $args{name},
- button_name => $args{button_name},
- button_value => $args{button_value},
- button_number => $args{button_number},
+ $self->Click(
+ 'name' => $args{'name'},
+ 'button_name' => $args{'button_name'},
+ 'button_value' => $args{'button_value'},
+ 'button_number' => $args{'button_number'},
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
);
}
@@ -153,9 +190,19 @@
);
if ($args{name}) {
- $self->Log("form_name", "'$args{name}'");
+ $self->Log(
+ 'form_name',
+ "'$args{name}'",
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
} else {
- $self->Log("form_number", $args{number});
+ $self->Log(
+ 'form_number',
+ $args{number},
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
}
@@ -167,13 +214,18 @@
@_
);
- return unless $args{name};
+ return unless $args{'name'};
# escape single quotes
- $args{name} =~ s/'/\\'/g;
- $args{value} =~ s/'/\\'/g if $args{value};
+ $args{'name'} =~ s/'/\\'/g;
+ $args{'value'} =~ s/'/\\'/g if $args{'value'};
- $self->Log("field", "'$args{name}', '" . ($args{value} || '') . "'");
+ $self->Log(
+ 'field',
+ "'$args{name}', '" . ($args{value} || '') . "'",
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
sub Check {
@@ -190,7 +242,12 @@
$args{name} =~ s/'/\\'/g;
$args{value} =~ s/'/\\'/g;
- $self->Log("tick", "'$args{name}', '$args{value}'");
+ $self->Log(
+ 'tick',
+ "'$args{name}', '$args{value}'",
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
sub UnCheck {
@@ -207,7 +264,12 @@
$args{name} =~ s/'/\\'/g;
$args{value} =~ s/'/\\'/g;
- $self->Log("untick", "'$args{name}', '$args{value}'");
+ $self->Log(
+ 'untick',
+ "'$args{name}', '$args{value}'",
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
sub Submit {
@@ -232,7 +294,12 @@
# TODO: also support button value, number
# Don't add this until WWW::Mechanize supports it
- $self->Log("submit_form", $submitargs);
+ $self->Log(
+ 'submit_form',
+ $submitargs,
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
sub Click {
@@ -248,7 +315,12 @@
# TODO: also support button value, number
# Don't add this until WWW::Mechanize supports it
- $self->Log("click", $clickargs);
+ $self->Log(
+ 'click',
+ $clickargs,
+ 'frame' => $args{'frame'},
+ 'target' => $args{'target'}
+ );
}
1;