[HTTP-Recorder] http-recorder adding ",1" to all input fields
Jonathan Wilson
jw at mailsw.com
Mon Jun 14 14:02:13 EDT 2004
Hello,
I'm attempting to use HTTP::Recorder to make some WWW:Mechanize scripts for
testing a web site. I have it mostly working but I'm having to problems:
1. I can't access the control panel.
I've tried the default URL and also tried changing it:
control => "http://reccontrol/"
But all I get is bad host name responses.
However, I can live with that as I don't absolutely have to have the control
panel.
2. What I do have to have is the ability to submit a form with some
information. However when I do that a strange thing is happening: some part
or the proxy is adding ",1" to everything.
For example I have a page on the site where I can order by catalog number --
all it wants it the number in the first field and quantity in the second. So
I would normally put in something like this:
BLAS 25
(and yes, there is nothing wrong with the web site I'm testing, I
double-checked that)
What happens when I use the proxy is that I get a response back from the web
site that the catalog number cannot be found, and with the fields changed to:
BLAS,1 25,1
I have tried this on a couple browsers (Konqueror, Mozilla 1.6) and it works
without the proxy but alway fail when the proxy is in use.
I am able to follow links with the proxy just fine, and it appears to be
recording ok.
My script to run the proxy is:
-------------------BEGIN SCRIPT---------------------
#!/usr/bin/perl -w
#This is HTTP::Recorder running as a daemon with HTTP::Proxy
use HTTP::Proxy;
use HTTP::Recorder;
my $proxy = HTTP::Proxy->new();
# set HTTP::Recorder as the agent
my $agent = HTTP::Recorder->new( file => "/tmp/http-recorder.log" );
# showwindow => 1
# spare futile attempts at accessing control panel
# control => "http://reccontrol/",
# create a new HTTP::Recorder object
#my $agent = new HTTP::Recorder;
# set the log file (optional)
#$agent->file("/tmp/http-recorder.log");
# set HTTP::Recorder as the agent for the proxy
$proxy->agent( $agent );
# you may need to set the host
$proxy->host( "jw" );
# start the proxy
$proxy->start();
1;
--------------------------END SCRIPT-------------------------
One other little thing I noticed: you cannot set the log file or anything else
in this manner: $agent->file("/tmp/http-recorder.log");
It only works as file => "/tmp/http-recorder.log" inside
HTTP::Recorder->new();
(Might not matter but I just thought I'd point it out as one other thing that
wasn't working right.
Using perl v5.8.4 from CPAN on Linux 2.4.21
If anyone can shed some light on the input field problem I would really
appreciate it.
Thanks!
JW
--
----------------------------------------------------
Jonathan Wilson
Cedar Creek Software http://www.cedarcreeksoftware.com
More information about the HTTP-Recorder
mailing list