I was getting the following error:
Error requesting http://localhost:4444/selenium-server/driver/:
500 read timeout
I and my colleague Mahesh checked the Selenium perl library code. It is not passing the timeout to the user agent, which is the issue. Normally people does not wait more than 3 minutes (180 seconds), so this issue might not have come to visibility. Anyhow, I have made a temporary fix locally only for the WaitForCondition command and it is working for higher timeout values.
Code changes in Selenium.pm are
$command = uri_escape($command);and
my $fullurl = "http://$self->{host}:$self->{port}/selenium-server/driver/";
my $content = "cmd=$command";
my $tmp_timeout = 180;
if ($command eq 'waitForCondition') {
$tmp_timeout = $args[1]/1000;
}
my $ua = LWP::UserAgent->new;I am not sure about other commands that require this fix, this fix just handle the timeout issue in $sel->wait_for_condition() API.
my $header = HTTP::Headers->new( Content_Type => 'application/x-www-form-urlencoded; charset=utf-8' );
if ($command eq 'waitForCondition') {
$ua->timeout($tmp_timeout);
}