Subject: | click() method always selects first button |
Hi, I've been changing some tests in some of my own code to use WWW::Automate, and came across a problem:
The click() method always clicks on the first button.
I had a look at the source, and the $button parameter wasn't being passed to the form's click() method.
I tried enabling use strict, and there was another apparently undefined variable in the field() method, it seems to use $form without defining it. I wasn't sure of the desired behaviour, so I haven't tried to provide a fix.
TonyC
--- WWW-Automate-0.20/lib/WWW/Automate.pm Tue Feb 19 03:29:10 2002
+++ WWW-Automate-0.20-new/lib/WWW/Automate.pm Sun Apr 7 23:15:48 2002
@@ -265,7 +265,7 @@
for ($x, $y) { $_ = 1 unless defined; }
$self->push_page_stack();
$self->{uri} = $self->{form}->uri;
- $self->{req} = $self->{form}->click($name, $x, $y);
+ $self->{req} = $self->{form}->click($button, $x, $y);
$self->do_request();
}