[Http-webtest-general] How to enable cookies in webtest
Brought to you by:
m_ilya,
richardanderson
From: archana <ar...@am...> - 2003-10-15 11:05:47
|
Hi, I am using http-webtest-2.04 for gui automation. Testing a box with ip 192.168.1.172 . It shows a login page with a click button. When used name and passwords are entered and a click button is pressed, http 200 is returned, but no cookies are recd. If try to access any other page in that , it says cookies not enabled and not logged in. I appreciate your help on this , wt script file is attached ========================= This is the log of the wt script. ================================= [root@archana ample1]# perl http2.pl Failed Succeeded Test Name 0 5 Login page 0 3 Submit correct username & password 1 3 get services page Test Name: Login page URL: http://192.168.1.172/cgi-bin/GConfigure?script=9 STATUS CODE CHECK Expected '200' and got: 200 OK SUCCEED FORBIDDEN TEXT Premature end of script headers SUCCEED Error processing directive SUCCEED REQUIRED TEXT User SUCCEED Password SUCCEED REQUEST HEADERS: GET http://192.168.1.172/cgi-bin/GConfigure?script=9 User-Agent: HTTP-WebTest/2.04 RESPONSE HEADERS: HTTP/1.0 200 OK Cache-Control: no-cache Connection: close Date: Fri, 02 Jan 1970 05:02:53 GMT Pragma: no-cache Server: Boa/0.94.9 Content-Type: text/html; charset=utf-8 Expires: 0 Client-Date: Wed, 15 Oct 2003 10:32:40 GMT Client-Peer: 192.168.1.172:80 Client-Response-Num: 1 Link: </custom.css>; rel="stylesheet" SENT COOKIE(S) *** none *** RECEIVED COOKIE(S) *** none *** 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> <center> <h1>HomeBASE<small><sup>TM</sup></small></h1> </center> <form name=login method=post action="/cgi-bin/GConfigure?script=9"> <table width=200px> <tr><th align=left width=120px>User ID</th><td><input type=text maxlength=15 siz e=15 name=id value="user"></td></tr> <tr><th align=left width=120px>Password</th><td><input type=password maxlength=1 5 size=15 name=passwd></td></tr> <tr><td><input type=submit value="Enter"></td></tr> </table> </form> </body> </html> Test Name: Submit correct username & password URL: http://192.168.1.172/cgi-bin/GConfigure?script=9&id=user&passwd=user STATUS CODE CHECK Expected '200' and got: 200 OK SUCCEED FORBIDDEN TEXT Premature end of script headers SUCCEED Error processing directive SUCCEED REQUEST HEADERS: GET http://192.168.1.172/cgi-bin/GConfigure?script=9&id=user&passwd=user User-Agent: HTTP-WebTest/2.04 RESPONSE HEADERS: HTTP/1.0 200 OK Cache-Control: no-cache Connection: close Date: Fri, 02 Jan 1970 05:02:53 GMT Pragma: no-cache Server: Boa/0.94.9 Content-Type: text/html; charset=utf-8 Expires: 0 Client-Date: Wed, 15 Oct 2003 10:32:40 GMT Client-Peer: 192.168.1.172:80 Client-Response-Num: 1 Link: </custom.css>; rel="stylesheet" SENT COOKIE(S) *** none *** RECEIVED COOKIE(S) *** none *** 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> <center> <h1>HomeBASE<small><sup>TM</sup></small></h1> </center> <form name=login method=post action="/cgi-bin/GConfigure?script=9"> <table width=200px> <tr><th align=left width=120px>User ID</th><td><input type=text maxlength=15 siz e=15 name=id value="user"></td></tr> <tr><th align=left width=120px>Password</th><td><input type=password maxlength=1 5 size=15 name=passwd></td></tr> <tr><td><input type=submit value="Enter"></td></tr> </table> </form> </body> </html> Test Name: get services page URL: http://192.168.1.172/cgi-bin/GConfigure?script=0 STATUS CODE CHECK Expected '200' and got: 200 OK SUCCEED FORBIDDEN TEXT Premature end of script headers SUCCEED Error processing directive SUCCEED REQUIRED TEXT Host FAIL REQUEST HEADERS: GET http://192.168.1.172/cgi-bin/GConfigure?script=0 User-Agent: HTTP-WebTest/2.04 RESPONSE HEADERS: HTTP/1.0 200 OK Cache-Control: no-cache Connection: close Date: Fri, 02 Jan 1970 05:02:53 GMT Pragma: no-cache Server: Boa/0.94.9 Content-Type: text/html; charset=utf-8 Expires: 0 Client-Date: Wed, 15 Oct 2003 10:32:40 GMT Client-Peer: 192.168.1.172:80 Client-Response-Num: 1 Link: </custom.css>; rel="stylesheet" SENT COOKIE(S) *** none *** RECEIVED COOKIE(S) *** none *** 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 onload="top.document.location='/frontpage.html'; alert('Not logged in: Coo kies not enabled');"> </body></html> Total web tests failed: 1 succeeded: 11 End of script ========================================================== thanks and regards, archana ---- plugins = ( ::Click ) #cookies = ( #( # version => 0 # name => USERID # value => user # path => / # domain => 192.168.1.172 # secure => 0 # maxage => 3600 #) #( # version => 0 # name => PASSWORD # value => user # path => / # domain => 192.168.1.172 # secure => 0 # maxage => 3600 #) # #) save_output=yes accept_cookies=yes send_cookies=yes show_cookies=yes ignore_case=yes show_html=yes show_headers=yes text_forbid = (Premature end of script headers Error processing directive ) test_name = Login page url = http://192.168.1.172/cgi-bin/GConfigure?script=9 text_require = ( User Password ) end_test test_name = Submit correct username & password click_button=Enter params=(script=>9 id=>user passwd =>user ) regex_require = (?*ADSL?*) end_test test_name = get services page url = http://192.168.1.172/cgi-bin/GConfigure?script=0 text_require = ( Host ) end_test |