Re: [Http-webtest-general] on_response problem
Brought to you by:
m_ilya,
richardanderson
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 |