414 Request URI Too Large

75 views
Skip to first unread message

balrog

unread,
May 3, 2008, 3:24:18 PM5/3/08
to selenium-users...@googlegroups.com

hello, I am using Selenium RC on Firefox 2.0.0.14 on FreeBSD 6.2 with JRE 1.6.


When I am trying to fill some text fields longer than lets say 1000 characters, i get following error: *414 Request URI Too Large*.


I assume that is due to the fact that Selenium driver (i mean main window which drives the child frame or child window) is being question with GET requests, and those request seem to be too large, is there any solution for this?





Regards, T. Kraus



balrog

unread,
May 3, 2008, 3:29:30 PM5/3/08
to selenium-users...@googlegroups.com

Java server says:





*20:30:52.420 WARN - null null null HttpException(414,Request URI Too Large,null)*
*20:30:53.413 INFO - Command request: click[//input[@value='Update'], ] on session 094b14dd86fe4923b0bd92d85dabe6c1*







And i forgot to add I am using perl driver.


Will be very thankful for any responses :)



balrog

unread,
May 3, 2008, 5:13:27 PM5/3/08
to selenium-users...@googlegroups.com
Okay, since there is no responses :P I had to hack it on my own.

This horrendal limit is due to Jetty FIXED non-modificable limit for max GET request.
Workaround for perl is splitting in chunks(same as somebody done with Python already)
My code ( i changed the function "type" in Selenium.pm) :
{code}
sub type {
my $self = shift;
my ($Locator, $Value) = @_;
my $MaxChars = 2000;
my $ValLen = length $Value;
if ($ValLen > $MaxChars) {
my $Pos = 0;
while ($Pos < $ValLen) {
my $Chunk = substr($Value, $Pos, $MaxChars);
$Chunk =~ s/\"/\\\"/g;
$Pos += $MaxChars;
my $JSCall = sprintf("selenium.browserbot.findElement(\"%s\").value += \"%s\";", $Locator, $Chunk);
$self->do_command("getEval", $JSCall);
sleep 2;
}
}
else {
$self->do_command("type", $Locator, $Value);
}
}


{code}


Reply all
Reply to author
Forward
0 new messages