http-webtest-general Mailing List for HTTP-WebTest (Page 5)
Brought to you by:
m_ilya,
richardanderson
You can subscribe to this list here.
| 2002 |
Jan
(1) |
Feb
(6) |
Mar
(2) |
Apr
(3) |
May
(6) |
Jun
(10) |
Jul
(24) |
Aug
(19) |
Sep
(8) |
Oct
(33) |
Nov
(11) |
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(20) |
Feb
(4) |
Mar
(28) |
Apr
(18) |
May
(6) |
Jun
|
Jul
(23) |
Aug
(5) |
Sep
(11) |
Oct
(29) |
Nov
(24) |
Dec
(10) |
| 2004 |
Jan
(2) |
Feb
(4) |
Mar
(40) |
Apr
(4) |
May
(8) |
Jun
(13) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
| 2005 |
Jan
(1) |
Feb
(7) |
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: William M. <wi...@kn...> - 2003-11-25 20:43:50
|
On Tue, Nov 25, 2003 at 12:17:52PM +0300, Ilya Martynov wrote: > Just tried following example and it worked correctly for me > (i.e. mailed results to both addresses): Hmm, it seems that you're right about it being a problem with my mail setup. I'm using exim on a Debian box, and I did find an error message about failing to open a database lock file which I was able to correct by fixing some incorrect permissions. However, I still fail to get two messages sent when they are going to the same email address. If they go to different addresses it works fine. Now that I think about it, I seem to recall reading that my webhost provider removes duplicates. I'll check into that possibility. Thanks for your reply! William -- Knowmad Services Inc. http://www.knowmad.com |
|
From: Ilya M. <il...@ip...> - 2003-11-25 09:17:58
|
>>>>> "WM" == William McKee <wi...@kn...> writes:
WM> Hi Ilya,
WM> I'm having troubles sending email to multiple addresses when a test
WM> fails. I'm using WebTest 2.04 and Net::SMTP 2.26. Here are my params:
WM> my $global_params = {
WM> # Global parameters
WM> ignore_case => 'yes',
WM> mail => 'errors',
WM> mail_addresses => [ 'wi...@kn...', 'k9...@kn...' ],
WM> mail_server => 'smtp-server.carolina.rr.com',
WM> mail_from => 'wi...@kn...',
WM> terse => 'failed_only',
WM> show_html => 'yes',
WM> show_cookies => 'yes',
WM> show_headers => 'yes',
WM> };
WM> The header fields will show that the mail is sent To: both addresses.
WM> However, only the first address receives the message. I have checked the
WM> code and can't find a problem with it. It appears to adhere to the
WM> Net::SMTP docs. I'm going to keep looking but wanted to see if anyone
WM> else had problems with sending to multiple addresses.
Just tried following example and it worked correctly for me
(i.e. mailed results to both addresses):
use HTTP::WebTest;
my $wt = HTTP::WebTest->new;
$wt->run_tests([ { url => 'http://localhost/',
text_require => [ 'Bla bla' ] } ],
{ mail => 'all',
mail_addresses => [ 'il...@ip...',
'il...@ma...' ] });
I had same versions of HTTP::WebTest and Net::SMTP
I'd check mail server logs for any errors.
--
Ilya Martynov, il...@ip...
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
|
|
From: William M. <wi...@kn...> - 2003-11-24 19:23:43
|
Hi Ilya,
I'm having troubles sending email to multiple addresses when a test
fails. I'm using WebTest 2.04 and Net::SMTP 2.26. Here are my params:
my $global_params = {
# Global parameters
ignore_case => 'yes',
mail => 'errors',
mail_addresses => [ 'wi...@kn...', 'k9...@kn...' ],
mail_server => 'smtp-server.carolina.rr.com',
mail_from => 'wi...@kn...',
terse => 'failed_only',
show_html => 'yes',
show_cookies => 'yes',
show_headers => 'yes',
};
The header fields will show that the mail is sent To: both addresses.
However, only the first address receives the message. I have checked the
code and can't find a problem with it. It appears to adhere to the
Net::SMTP docs. I'm going to keep looking but wanted to see if anyone
else had problems with sending to multiple addresses.
Thanks,
William
--
Knowmad Services Inc.
http://www.knowmad.com
|
|
From: Thieme.Geoff <Geo...@we...> - 2003-11-17 22:48:55
|
Ilya mentioned a new libwww release was out that seems may have changes
relevant to my problem. Installing the newest LWP fixed my POST to an SSL
cluster problem w/WebTest 2.04. Thanks for the great support Ilya!
My CPAN install of LWP installed libwww-perl 5.75 and HTML::Parser 3.34.
-----Original Message-----
From: Thieme.Geoff
Sent: Friday, October 03, 2003 10:36 AM
To: 'Ilya Martynov'
Cc: htt...@li...;
ri...@ri...; Thieme.Geoff
Subject: RE: [Http-webtest-general] Temporary redirect and POST don't
work together
It worked. I did a print $response->title just to make sure it brought back
the correct page title, and it did.
Here is the output of "use LWP::Debug ('+');" using the reverse proxy:
$ time ./WebTestTester.pl
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST https://externalsite/loginvalidation.jsp
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Found
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST https://externalsite/loginfailed.jsp
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 3955 bytes
LWP::UserAgent::request: Simple response: OK
My Page - Login Failedok
real 0m3.820s
user 0m0.851s
sys 0m0.203s
"My Page - Login Failedok" includes the $response->title. BTW, this test is
supposed access loginfailed.jsp and say Login Failed.
Here is the debug output when accessing an internal web site SSL directly:
$ time ./WebTestTester.pl
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST https://internalsite/loginvalidation.jsp
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Found
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: POST https://internalsite/loginfailed.jsp
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 3955 bytes
LWP::UserAgent::request: Simple response: OK
My Page - Login Failedok
real 0m1.740s
user 0m0.851s
sys 0m0.143s
The only difference I can see from testing with the debug code is that using
the reverse proxy takes a lot longer.
I looked at the HTTP headers using Lynx to see if there was a difference
between using the reverse proxy and not using it. I didn't see any
difference from what Lynx was able to show me.
Header when accessing loginvalidation.jsp:
HTTP/1.1 302 Moved Temporarily
Server: Netscape-Enterprise/4.1
Date: Fri, 03 Oct 2003 15:19:29 GMT
Set-cookie: jsessionid=378601065194369869;path=/
Location: https://externalsite/loginfailed.jsp
Expires: now
Content-type: text/html; charset=iso-8859-1
Cache-control: no-cache="set-cookie,set-cookie2"
Connection: Close
Connection: close
Header when finished and stilling on the loginfailed.jsp page:
HTTP/1.1 200 OK
Server: Netscape-Enterprise/4.1
Date: Fri, 03 Oct 2003 15:28:00 GMT
Connection: Keep-alive
Expires: now
Content-type: text/html; charset=iso-8859-1
Content-length: 8049
Connection: close
This leads me to believe there must be differences not seen in the headers.
I don't remember if I actually tested a post on an SSL site w/a reverse
proxy using HTTP::WebTest 1.xx . I know I tested using a non SSL site.
-Geoff
-----Original Message-----
From: Ilya Martynov [mailto:il...@ip...]
Sent: Friday, October 03, 2003 3:13 AM
To: Thieme.Geoff
Cc: htt...@li...;
ri...@ri...
Subject: Re: [Http-webtest-general] Temporary redirect and POST don't
work together
>>>>> "TG" == Thieme Geoff <Geo...@we...> writes:
TG> [..snip..]
TG> I've run out of ideas to try. If WebTest still allows LWP to
TG> handles redirects internally, this may be a problem with
TG> LWP. Anyone have any other ideas? I can give you web site address
TG> URL and user name if you think it might help.
Can you please try following test script:
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->requests_redirectable([qw(GET HEAD POST)]);
my $response = $ua->post('http://your.site.url',
{ login => 'xxx', password => 'yyy' });
if ($response->is_success) {
print "ok\n"
} else {
print "Error: " . $self->status_line . "\n";
}
If it reproduces the problem (i.e. you get same error message) then it
should be either a problem in LWP or in reverse proxy.
You can add
use LWP::Debug (+);
to get all debug log from LWP::Debug. They may be helpful to find
what's going on.
As I understand HTTP::WebTest 1.xx didn't use
$ua->requests_redirectable([qw(GET HEAD POST)]) to let LWP::UserAgent
$ua->handle redirects after POST but was doing it itself. Probably it
$ua->explains the difference.
TG> [..snip..]
--
Ilya Martynov, il...@ip...
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
|
|
From: William M. <wi...@kn...> - 2003-11-13 15:33:09
|
On Thu, Nov 13, 2003 at 04:51:04PM +0300, Ilya Martynov wrote: > It definitely sounds like interesting idea. And it shouldn't be very > hard to implement. That's what I really wanted to know. I appreciate your input on how to implement. My thinking was that each misspelled word would be presented along with a list of alternatives. I'll put it on my list of projects but unfortunately don't have a time frame for implementation :(. Thanks, William -- Knowmad Services Inc. http://www.knowmad.com |
|
From: Ilya M. <il...@ip...> - 2003-11-13 13:51:10
|
>>>>> "WM" == William McKee <wi...@kn...> writes: WM> Hi Ilya, WM> Thanks for the references. I did come across these two packages but WM> didn't see any pre-written scripts for doing bulk testing of websites. WM> Do you think it would be feasible to write a plugin for HTTP::WebTest to WM> do spellchecking using one of these libraries (prob. ispell since it has WM> more dictionaries)? It definitely sounds like interesting idea. And it shouldn't be very hard to implement. Basically plugin should get $response->content then spellcheck it via Text::Aspell or Text::Ispell. IIRC both support spellchecking in HTML documents so you don't even have to bother with parsing HTML. For each misspelling plugin should report an error. If no misspellings test passes. Obviously you need to deal with situation when correct word is not in dictionary. Maybe use a test paramater which points to a file with additional word list. If you need any help with implementation of such plugin just ask. -- Ilya Martynov, il...@ip... CTO IPonWEB (UK) Ltd Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net Personal website - http://martynov.org |
|
From: William M. <wi...@kn...> - 2003-11-13 13:25:14
|
Hi Ilya, Thanks for the references. I did come across these two packages but didn't see any pre-written scripts for doing bulk testing of websites. Do you think it would be feasible to write a plugin for HTTP::WebTest to do spellchecking using one of these libraries (prob. ispell since it has more dictionaries)? Thanks, William -- Knowmad Services Inc. http://www.knowmad.com |
|
From: Ilya M. <il...@ip...> - 2003-11-13 10:44:45
|
>>>>> "WM" == William McKee <wi...@kn...> writes: WM> Hi Folks, WM> I wanted to ask for advice of the list for info about WM> spell-checking websites. Does anyone know of a GPL spellchecker? WM> I checked Google but didn't come up with anything. Something along WM> the lines of WebTest or Linklint would be preferably instead of WM> having to manually check each page. ispell (http://xrl.us/34f) and aspell (http://xrl.us/34g). Aspell is more advanced than ispell but ispell have more dictionaries than aspell so for some (human) languages you have to stick with ispell. And of course there are exist Perl bindings for various spellcheckers: http://xrl.us/34h -- Ilya Martynov, il...@ip... CTO IPonWEB (UK) Ltd Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net Personal website - http://martynov.org |
|
From: William M. <wi...@kn...> - 2003-11-12 15:45:42
|
Hi Folks, I wanted to ask for advice of the list for info about spell-checking websites. Does anyone know of a GPL spellchecker? I checked Google but didn't come up with anything. Something along the lines of WebTest or Linklint would be preferably instead of having to manually check each page. Thanks in advance, William -- Knowmad Services Inc. http://www.knowmad.com |
|
From: Ilya M. <il...@ip...> - 2003-11-11 11:22:24
|
>>>>> "BK" == Ben Kelly <ben...@hi...> writes: BK> I've been thinking about knocking together a web front end for BK> users to run tests on. Thought I'd better check to see if anyone BK> has done something similar - no use reinventing the wheel. If this BK> sort of resource is available, can some kind soul point me toward BK> it? I started working on such thing but had not time to finish it. I had in my mind a tool which can 1. record web sessions (the tool acts as HTTP proxy) 2. autogenerate test scripts from web sessions 3. edit tests scripts (including autogenerated) 4. replay test scripts all via web interface. Unfortunately I didn't have much free time to finish it so for now it only does #1 and has very incomplete support for #2. There is no code for #3 and #4 at all. If you are interested take it from CVS (http://xrl.us/3ps). Project is called HTTP-WebTest-Recorder. If you really want to do a web front end for users to run tests I'd love it to be a part of HTTP-WebTest-Recorder. -- Ilya Martynov, il...@ip... CTO IPonWEB (UK) Ltd Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net Personal website - http://martynov.org |
|
From: Ben K. <ben...@hi...> - 2003-11-11 03:32:57
|
I've been thinking about knocking together a web front end for users to = run tests on. Thought I'd better check to see if anyone has done = something similar - no use reinventing the wheel. If this sort of = resource is available, can some kind soul point me toward it? Cheers. |
|
From: William M. <wi...@kn...> - 2003-11-10 14:28:53
|
On Mon, Nov 10, 2003 at 03:44:10PM +0530, archana wrote: > Now tell me how do i get the Upstream /Downstream value > > I want to get upstream and down stream value for fastmode. You need to rewrite your regex to match the following string: Upstream Rate (fast mode)</th><td>896 Kbps Your current regex isn't working because you are not checking for the tags. My guess is that the \D class is not catching the forward slash or the angle brackets. Are you sure that you are using it correctly? Whenever I have a regex that is not working as expecting, I create a throwaway Perl script to test it. I suspect you'll find that you need to modify your regex to match the string. Good luck, William -- Knowmad Services Inc. http://www.knowmad.com |
|
From: archana <ar...@am...> - 2003-11-10 10:10:21
|
I have put show_html and show_header ON.
To get any page i have to give complete path like
http://192.168.10.1/cgi-bin/GConfigure?script=5 to get the status page
on which i am looking for a number.
*******************************************
whose contents are,
------------------
PAGE CONTENT:
<html><head><link rel=stylesheet href=/custom.css>
<META HTTP-EQUIV = "Pragma" CONTENT="no-cache">
<META HTTP-EQUIV = "Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV = "Expires" CONTENT="0">
</head>
<body>
<h1>ADSL State</h1>
<table width=600px>
<tr><th align=left width=300px>DMT Software Version</th><td align=left>
version 1.00.04 R1.19.7 SD MCONF-HPF2-5D5V</td></tr><tr><th align=left
width=300px>State</th><td align=left>showtime</td></tr>
<tr><th align=left width=300px>Mode</th><td align=left>G.dmt Annex
A</td></tr>
<tr><th align=left width=300px>Upstream Rate (interleaved
mode)</th><td>0 Kbps</td></tr>
<tr><th align=left width=300px>Upstream Rate (fast mode)</th><td>896
Kbps</td></tr>
<tr><th align=left width=300px>Downstream Rate (interleaved
mode)</th><td>0 Kbps</td></tr>
<tr><th align=left width=300px>Downstream Rate (fast mode)</th><td>8128
Kbps</td></tr>
<tr><th align=left width=300px>Upstream SNR</th><td>11.0 dB</td></tr>
<tr><th align=left width=300px>DownStream SNR</th><td>17.0 dB</td></tr>
<tr><th align=left width=300px>Upstream Cell Rate (interleaved
mode)</th><td>Total 0 (active 0) CPS</td></tr>
<tr><th align=left width=300px>Upstream Cell Rate (fast
mode)</th><td>Total 2113 (active 0) CPS</td></tr>
<tr><th align=left width=300px>Downstream Cell Rate (interleaved
mode)</th><td>Total 0 (active 0) CPS</td></tr>
<tr><th align=left width=300px>Downstream Cell Rate (fast
mode)</th><td>Total 19169 (active 2) CPS </td></tr>
<tr><th align=left width=300px>CRC Counts</th><td>0 in 214 minute (0 per
15-minute count, 0 per 24-hour count) (Tx CRC:0)</td></tr>
<tr><td><a href=/cgi-bin/GConfigure?script=5&2 target=main>Reset CRC
counters</a></td></tr>
</table>
<br>
<br><a href="/cgi-bin/GConfigure?script=5&0" target="main">Refresh</a>
</body></html>
***********************************************************************
When checked with a mozilla browser, 2 frames are displayed. Left frame
is http://192.168.10.1/cgi-bin/GConfigure?script=0.
whose contents are
-------------------
<html>
<head>
<link rel=stylesheet href=/custom.css>
<META HTTP-EQUIV = "Pragma" CONTENT="no-cache">
<META HTTP-EQUIV = "Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV = "Expires" CONTENT="0">
<script language="javascript">
var logo = new Image();
logo.src = "/logo.gif";
function resetConfirm()
{
var ans = confirm('Are you sure you want to reset the configuration to
the factory defaults ?');
if (ans)
{
return true;
}else
{
return false;
}
}
function rebootConfirm()
{
var ans = confirm('Are you sure you want to reboot ?');
if (ans)
{
return true;
}else
{
return false;
}
}
function supConfirm()
{
var ans = confirm('Are you sure you want to update the software (the
modem will require rebooting) ?');
if (ans)
{
return true;
}else
{
return false;
}
}
//-->
</script>
<body>
<table width=100%>
<tr><td><img height="82px" width="116px" src="/logo.gif"></td></tr>
<tr><td><b>HomeBASE</b><sup>TM</sup></td></tr>
<tr><td><hr size="3px" width="100px" align="left"></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=5&1" target=main>Connections
Status</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=4" target=main>Connection
Configuration</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=20" target=main>Traffic
Shaping Profile</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=6" target=main>Firewall
Profile</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=25" target=main>IPsec
Profile</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=8" target=main>Save
Configuration</a></td></tr>
<tr><td><hr size="3px" width="100px" align="left"></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=1" target=main>LAN
Interface</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=23" target=main>MAC
Filter</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=19" target=main>Static
Route</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=2"
target=main>Services</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=3" target=main>DHCP
Server</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=18" target=main>DHCP
Relay</a></td></tr>
<tr><td><hr size="3px" width="100px" align="left"></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=12" target=main
onclick="return rebootConfirm();">Reboot</a></td></tr>
<tr><td><hr size="3px" width="100px" align="left"></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=11" target=main
onclick="return resetConfirm();">Reset to factory defaults</a></td></tr>
<tr><td><hr size="3px" width="100px" align="left"></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=21" target=main>Toggle
Locale</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=14&1" target=main
onclick="return supConfirm();">Software Update</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=7"
target=main>Password</a></td></tr>
<tr><td><a href="/cgi-bin/GConfigure?script=10"
target=main>Logout</a></td></tr>
<tr><td><hr size="3px" width="100px" align="left"></td></tr>
<tr><td><p>Login: user<br>Version: 2.1.6</p></td></tr>
</table>
</body>
</html>
My current script goes like this,
--------------------------------
{
test_name => 'password',
show_cookies => 'yes',
max_bytes => 10000,
ignore_case => 'yes',
show_html => 'yes',
show_header =>'yes',
text_forbid => [
'Premature end of script headers',
'Error processing directive'
],
url => 'http://192.168.10.1/cgi-bin/GConfigure?script=5&0',
on_response => {
($up) = $webtest->current_response->content =~ /Upstream Rate
\(fast mode\)\D*(\d+) Kbps/,
($b1)=$webtest->current_response->content(),
($one) = $webtest->current_response->content =~
/width=(\d+)/,
($down) = $webtest->current_response->content =~ /Downstream
Rate \(fast mode\)\D*(\d+) Kbps/i
},
print "*********$up*******\n"
}
Results are
------------
*********100*******
Now tell me how do i get the Upstream /Downstream value
I want to get upstream and down stream value for fastmode.
I appreciate your help on this,
thanks and regards,
Archana
On Fri, 2003-11-07 at 14:02, William McKee wrote:
> On Fri, Nov 07, 2003 at 06:10:48PM +0530, archana wrote:
> > No this is also not working...
> > More inputs please!!
>
> Archana,
>
> You need to provide the list with more info about what is going wrong.
> "It is not working" is insufficient information to help you debug the
> problem. Did you turn on debugging as I suggested in my previous email?
> What is the output? Try restating your problem as well. I use
> on_response in several of my tests and have no problems with it. Have
> you tested that your regex is working? What do you mean by "on_response
> fails"?
>
> Hope this helps,
> William
>
> --
> Knowmad Services Inc.
> http://www.knowmad.com
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Http-webtest-general mailing list
> Htt...@li...
> https://lists.sourceforge.net/lists/listinfo/http-webtest-general
|
|
From: William M. <wi...@kn...> - 2003-11-07 13:32:54
|
On Fri, Nov 07, 2003 at 06:10:48PM +0530, archana wrote: > No this is also not working... > More inputs please!! Archana, You need to provide the list with more info about what is going wrong. "It is not working" is insufficient information to help you debug the problem. Did you turn on debugging as I suggested in my previous email? What is the output? Try restating your problem as well. I use on_response in several of my tests and have no problems with it. Have you tested that your regex is working? What do you mean by "on_response fails"? Hope this helps, William -- Knowmad Services Inc. http://www.knowmad.com |
|
From: archana <ar...@am...> - 2003-11-07 12:37:16
|
No this is also not working...
More inputs please!!
On Thu, 2003-11-06 at 19:23, William McKee wrote:
> On Thu, Nov 06, 2003 at 04:00:18PM +0530, archana wrote:
> > I have perl script with webtest object created from HTTP:WebTest.
> > Logging in to a page and trying to get value of a variable. When i am
> > using the following command, i am unable to get correct value of
> > variable. Rather content file is not showing the correct contents of the
> > page. Text require gets the expected value from teh page but on_response
> > fails.
>
> It sounds like you are saying there are three problems:
> 1) response page is not correct ("Rather content file is not showing the correct contents of the page")
> 2) $up does not get a value
> 3) text_require works
>
> If 1 is really a problem, then you should turn on debugging. I use the
> following:
>
> terse = failed_only
> show_html = yes
> show_cookies = yes
> show_headers = yes
>
> > Can anyone help me with this problem?
>
> Try changing the on_response to the following (I added parens around the
> $up variable):
>
> on_response => {
> ($up) = $webtest->current_response->content =~ /Upstream Rate\(fast mode\)\D*(\d+) Kbps/
> }
>
> William
>
> --
> Knowmad Services Inc.
> http://www.knowmad.com
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Http-webtest-general mailing list
> Htt...@li...
> https://lists.sourceforge.net/lists/listinfo/http-webtest-general
|
|
From: William M. <wi...@kn...> - 2003-11-06 13:54:06
|
On Thu, Nov 06, 2003 at 04:00:18PM +0530, archana wrote:
> I have perl script with webtest object created from HTTP:WebTest.
> Logging in to a page and trying to get value of a variable. When i am
> using the following command, i am unable to get correct value of
> variable. Rather content file is not showing the correct contents of the
> page. Text require gets the expected value from teh page but on_response
> fails.
It sounds like you are saying there are three problems:
1) response page is not correct ("Rather content file is not showing the correct contents of the page")
2) $up does not get a value
3) text_require works
If 1 is really a problem, then you should turn on debugging. I use the
following:
terse = failed_only
show_html = yes
show_cookies = yes
show_headers = yes
> Can anyone help me with this problem?
Try changing the on_response to the following (I added parens around the
$up variable):
on_response => {
($up) = $webtest->current_response->content =~ /Upstream Rate\(fast mode\)\D*(\d+) Kbps/
}
William
--
Knowmad Services Inc.
http://www.knowmad.com
|
|
From: Johannes la P. <joe...@us...> - 2003-11-06 11:01:42
|
Archana,
Why not just stick to the predefined "regex_require" method?
So rather than:
> on_response => {
> $up = $webtest->current_response->content =~ /Upstream Rate
> \(fast mode\)\D*(\d+) Kbps/
use:
...
text_require => 'showtime',
regex_require => '/Upstream Rate \(fast mode\)\D*(\d+) Kbps/',
...
Cheers,
Joe.
|
|
From: archana <ar...@am...> - 2003-11-06 10:26:49
|
Hi,
I have perl script with webtest object created from HTTP:WebTest.
Logging in to a page and trying to get value of a variable. When i am
using the following command, i am unable to get correct value of
variable. Rather content file is not showing the correct contents of the
page. Text require gets the expected value from teh page but on_response
fails.
Can anyone help me with this problem?
test case looks somewhat like this,
$webtest->run_test(
[
url = http://192.168.1.10
text_require => 'showtime',
on_response => {
$up = $webtest->current_response->content =~ /Upstream Rate
\(fast mode\)\D*(\d+) Kbps/
}
]
);
thanks and regards,
Archana
|
|
From: archana <ar...@am...> - 2003-11-03 10:13:28
|
thanks for solution.
I am able to get info of test cases pass/fail properly.
regards,
archana
On Mon, 2003-11-03 at 15:11, Ilya Martynov wrote:
> >>>>> "A" == archana <ar...@am...> writes:
>
> A> Hi,
> A> Is there a way i can get a buffer containing number of test cases passed
> A> and failed after running a perl script having multiple test cases?
>
> A> The results are formatted and being displayed properly. I need to have
> A> them in some var/buffer so that i can re-use info for testing.
>
> After running all tests you can get all results via Perl API:
>
> my $wt = HTTP::WebTest->new;
> $wt->run_wtscript('tests.wt');
>
> print "Total number of failed tests: ", $wt->num_fail, "\n";
> print "Total number of passed tests: ", $wt->num_succeed, "\n";
>
> my @tests = @{$wt->tests};
> for my $i (0 .. @tests - 1) {
> print "Test #$i: ";
> for my $result ($test->results) {
> print $result->ok ? 'pass' : 'fail';
> }
> print "\n";
> }
>
> see perldoc HTTP::WebTest::API, HTTP::WebTest::Test and
> HTTP::WebTest::TestResult.
>
> --
> Ilya Martynov, il...@ip...
> CTO IPonWEB (UK) Ltd
> Quality Perl Programming and Unix Support
> UK managed @ offshore prices - http://www.iponweb.net
> Personal website - http://martynov.org
|
|
From: Ilya M. <il...@ip...> - 2003-11-03 09:42:44
|
>>>>> "IM" == Ilya Martynov <il...@ip...> writes:
>>>>> "A" == archana <ar...@am...> writes:
A> Hi,
A> Is there a way i can get a buffer containing number of test cases passed
A> and failed after running a perl script having multiple test cases?
A> The results are formatted and being displayed properly. I need to have
A> them in some var/buffer so that i can re-use info for testing.
IM> After running all tests you can get all results via Perl API:
IM> my $wt = HTTP::WebTest->new;
IM> $wt->run_wtscript('tests.wt');
IM> print "Total number of failed tests: ", $wt->num_fail, "\n";
IM> print "Total number of passed tests: ", $wt->num_succeed, "\n";
IM> my @tests = @{$wt->tests};
IM> for my $i (0 .. @tests - 1) {
IM> print "Test #$i: ";
Forgot line
my $test = $tests[$i];
IM> for my $result ($test->results) {
IM> print $result->ok ? 'pass' : 'fail';
IM> }
IM> print "\n";
IM> }
IM> see perldoc HTTP::WebTest::API, HTTP::WebTest::Test and
IM> HTTP::WebTest::TestResult.
--
Ilya Martynov, il...@ip...
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
|
|
From: Ilya M. <il...@ip...> - 2003-11-03 09:42:06
|
>>>>> "A" == archana <ar...@am...> writes:
A> Hi,
A> Is there a way i can get a buffer containing number of test cases passed
A> and failed after running a perl script having multiple test cases?
A> The results are formatted and being displayed properly. I need to have
A> them in some var/buffer so that i can re-use info for testing.
After running all tests you can get all results via Perl API:
my $wt = HTTP::WebTest->new;
$wt->run_wtscript('tests.wt');
print "Total number of failed tests: ", $wt->num_fail, "\n";
print "Total number of passed tests: ", $wt->num_succeed, "\n";
my @tests = @{$wt->tests};
for my $i (0 .. @tests - 1) {
print "Test #$i: ";
for my $result ($test->results) {
print $result->ok ? 'pass' : 'fail';
}
print "\n";
}
see perldoc HTTP::WebTest::API, HTTP::WebTest::Test and
HTTP::WebTest::TestResult.
--
Ilya Martynov, il...@ip...
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
|
|
From: archana <ar...@am...> - 2003-11-03 08:55:12
|
Hi, Is there a way i can get a buffer containing number of test cases passed and failed after running a perl script having multiple test cases? The results are formatted and being displayed properly. I need to have them in some var/buffer so that i can re-use info for testing. thanks, Archana |
|
From:
<joe...@us...> - 2003-10-30 20:22:32
|
archana wrote:
>Thanks William,
>
>But what i am looking at is putting everything in perl script rather
>than using 'wt' file. And i wanted info on how i can mention list of
>global test parameters before any testcase?
>
>
>
archana,
Sorry to say so, but RTFM aill reveal that you can pass the run_tests
method two data structures, one consisting of global parameters and the
other an array of hashes with test descriptions.
Everything is nicely documented in the main documentation, and then
there is the cookbook with nice examples.
Try (on the command prompt):
$ perldoc HTTP::WebTest
SYNOPSIS
use HTTP::WebTest;
my $webtest = new HTTP::WebTest;
# run test from file
$webtest->run_wtscript('script.wt');
# or (to pass test parameters as method arguments)
$webtest->run_tests($tests);
[...]
You want the second alternative.
You can also read this online:
http://search.cpan.org/~ilyam/HTTP-WebTest-2.04/lib/HTTP/WebTest.pm
Special attention to section:
Calling HTTP::WebTest from a Perl program (just click below):
http://search.cpan.org/~ilyam/HTTP-WebTest-2.04/lib/HTTP/WebTest.pm#Calling_HTTP::WebTest_from_a_Perl_program
There you have it, with examples and all...
Good webtest scripting!
Cheers,
Joe.
|
|
From: archana <ar...@am...> - 2003-10-30 11:07:45
|
Thanks William, But what i am looking at is putting everything in perl script rather than using 'wt' file. And i wanted info on how i can mention list of global test parameters before any testcase? thanks, archana On Wed, 2003-10-29 at 19:31, William McKee wrote: > On Wed, Oct 29, 2003 at 03:12:04PM +0530, archana wrote: > > How do i define the global test parameters in perl script which uses an > > object of webtest? > > RTFM. You can pass in parameters via the run_wtscript command. I have a > control script which cycles through a directory of wt test files. It'd > be a simple matter of adding the global parameters to this perl script. > > In addition, I use a Perl parameter in my wt scripts to set the url so > that I can quickly switch between running the tests on my test server or > the production server. I used to have to change the url value in each wt > script until Ilya showed me how I could set it from the global perl > program. See the thread "Passing optional parameters" from last month in > the newsgroup archives on SourceForge. > > Hope this helps, > William > > -- > Knowmad Services Inc. > http://www.knowmad.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Http-webtest-general mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/http-webtest-general |
|
From: William M. <wi...@kn...> - 2003-10-29 14:03:04
|
On Wed, Oct 29, 2003 at 03:12:04PM +0530, archana wrote: > How do i define the global test parameters in perl script which uses an > object of webtest? RTFM. You can pass in parameters via the run_wtscript command. I have a control script which cycles through a directory of wt test files. It'd be a simple matter of adding the global parameters to this perl script. In addition, I use a Perl parameter in my wt scripts to set the url so that I can quickly switch between running the tests on my test server or the production server. I used to have to change the url value in each wt script until Ilya showed me how I could set it from the global perl program. See the thread "Passing optional parameters" from last month in the newsgroup archives on SourceForge. Hope this helps, William -- Knowmad Services Inc. http://www.knowmad.com |