Subject: | The module doesn't use POST to send request to Selenium server (since ver. 1.20) |
Date: | Fri, 3 Sep 2010 18:10:59 +0900 |
To: | bug-Test-WWW-Selenium [...] rt.cpan.org |
From: | So Matsui <matsui [...] shanon.co.jp> |
Hello, Test-WWW-Selenium mainteners
I'm using Test-WWW-Selenium for testing of our web application product,
but have a problem when using the latest version of the module.
Since versinon 1.16, it was changed to use POST to send request
to Selenium server, but since 1.20, it was changed back to use GET.
For this, I cannot submit long text data when I use the latest version.
(URI too-long error occurs)
The changes made in 'do_command' method between 1.19 and 1.20:
==================================================
@@ -436,24 +455,24 @@
}
$command = uri_escape($command);
- my $fullurl = "http://$self->{host}:$self->{port}/selenium-server/driver/";
- my $content = "cmd=$command";
+ my $fullurl = "http://$self->{host}:$self->{port}/selenium-server/driver/"
+ . "\?cmd=$command";
my $i = 1;
@args = grep defined, @args;
while (@args) {
- $content .= "&$i=" . URI::Escape::uri_escape_utf8(shift @args);
+ $fullurl .= "&$i=" . URI::Escape::uri_escape_utf8(shift @args);
$i++;
}
if (defined $self->{session_id}) {
- $content .= "&sessionId=$self->{session_id}";
+ $fullurl .= "&sessionId=$self->{session_id}";
}
print "---> Requesting $fullurl\n" if $self->{verbose};
# We use the full version of LWP to make sure we issue an
# HTTP 1.1 request (SRC-25)
- my $ua = LWP::UserAgent->new;
- my $header = HTTP::Headers->new( Content_Type =>
'application/x-www-form-urlencoded; charset=utf-8' );
- my $response = $ua->request( HTTP::Request->new( 'POST',
$fullurl, $header, $content ) );
+
+ my $ua = $self->ua;
+ my $response = $ua->request( HTTP::Request->new(GET => $fullurl) );
my $result;
if ($response->is_success) {
$result = $response->content;
==================================================
I could not guess the reason it was changed back like this,
so if it's unintended changes, I wish it be fixed to use POST again.
For information, our Perl version is v5.8.2, and OS is Linux (CentOS 5.2).
Thank you.
--
So Matsui <matsui@shanon.co.jp>
Shanon, Inc.