Greetings Ilya,
I received a couple of error messages today from a script which I'm
running every minute via a crontab. The errors indicate that WebTest
received a 500 - Internal Server Error message. However, I saw no such
errors in my server logs.
I began to wonder whether WebTest just couldn't connect to the server. So
I created a sample script (see below) to try to test this theory. Indeed,
it seems that when WebTest cannot access a server (due to an invalid url
or a connection timeout), it is returning a 500 error.
This response does not seem accurate. I'm not sure where this status code
is coming from but was able to track the actual error message to the
StatusTest.pm module. Could you test and verify my results? Do you use the
LWP to make the actual connections? Is this error message generated from
those libraries?
Thanks,
William
---------------
#!/usr/bin/perl -Tw
#
# TESTING HTTP::WEBTEST
#
use strict;
use HTTP::WebTest;
my $wtscript_testfile;
my $webtest = new HTTP::WebTest;
my $tests = [
# Test 1
{
test_name => 'Yahoo Homepage',
url => 'http://www.yahoo.com',
text_require => [ 'Yahoo'],
text_forbid => [ 'The server encountered an internal error' ],
},
# Test 2
{
test_name => 'Bad URL',
url => 'http://www.yahoo.edu',
params => {},
text_require => [ 'Yahoo U' ],
text_forbid => [ 'The server encountered an internal error' ],
},
];
my $params = {
ignore_case => 'yes',
terse => 'failed_only',
show_html => 'yes',
};
$webtest->run_tests($tests, $params);
--------------
--
Lead Developer
Knowmad Services Inc. || Internet Applications & Database Integration
http://www.knowmad.com
|