|
|
vennela222
Newbie
Reged: 10/31/11
Posts: 7
|
|
i recorded the login page with the valid username and password. Later i modified the script with invalid username and password then i ran the script. But the script got passed. Could you please suggest me how OpenSTA will validate the Login Page?
|
Bernie Velivis
Moderator
Reged: 06/02/03
Posts: 1604
Loc: Hollis, NH, USA
|
|
You can validate that a request has returned expected results by looking at the http status code (if > 400, usually it did not work). Even if you get a 200 code back, there still could be an error. Only way to be sure is to search for a string in the response that indicates success.
for example;
PRIMARY GET URI "http://www.opensta.org/ HTTP/1.0" ON 2 & HEADER DEFAULT_HEADERS & ,WITH {"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, " & "application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, " & "application/msword, */*", & "Accept-Language: en-us", & "Connection: Keep-Alive"} & ,WITHOUT {"Referer"}
load response_info body on 2 into buffer !log buffer set successString = "OpenSTA Users Home Page" set offset = ~locate(successString, buffer), CASE_BLIND if (offset = -1) then Log "VERIFY RESULTS FAILED! Couldnt find ",successString ," in ", buffer exit endif
This technique is somewhat limited by the maximum variable size (for the variable BUFFER in this example), which is 64Kb.
-------------------- Bernie Velivis, Performax Inc
Bernie's blog
|
vennela222
Newbie
Reged: 10/31/11
Posts: 7
|
|
Thank you very much Bernie
|
|
0 registered and 1 anonymous users are browsing this forum.
Moderator: SteveKay, AJ, dansut, Bernie Velivis
Print Topic
|
Forum Permissions
You cannot start new topics
You cannot reply to topics
HTML is disabled
UBBCode is enabled
|
Rating:
Topic views: 1556
|
|
|
|
|
|
Powered by UBB.threads™ 6.5.5
|