i new web , load testing in vs. not using recorder since there garbage traffic weed out. recorders tend confuse , obfuscate me rather illuminate. simulating login process of our application in order retrieve authentication token pass services want test. walking step-by-step while watching traffic in fiddler.
so step 1, navigate url of aut. when this, see series of redirects outcome new url cookie , query string in request, , login form in response.
in next request, include cookie , query string of former redirect request issuing. not writing code yet @ point using test designer. how retrieve values include in next request?
thanks
possible ways include:
(1) set follow redirects
property on request false
, create requests each url in chain of redirects. add extraction rules @ relevant places , use extracted values in subsequent requests. normal approach when there 1 redirect, or perhaps small number of them.
(2) similar above, write plugin redirect handling , adds next request in chain test.
generally cookies , query string parameters extracted responses , written requests, not extracted requests. visual studio web tests handle cookies without needing help.
values of query string parameters can come many places in response. if special cookie handling needed can extracted responses extracthttpheader
extraction rule header field set-cookie
.
if need extract values request prerequest
plugins can access pieces of request before sent.
for request trying handle envisage using 3 requests, each follow redirects
set false
. are:
(1)
request: http://localhost:12345 response: extract port number , other url fragments context parameters `portnumber1` , `urlfragment1`, etc.
(2)
request: http://localhost:{{portnumber1}}/{{urlfragment1}} response: extract redirected url `url2` , cookie(s) `cookies2`
(3)
request: http://{{url2}}/ query string parameters written header fields, either fields in web test or plugin creating values response: ...
you might reconsider using web test recorder. find job in creating web test. additional work needed handle dynamic parameters kind of work needed or without recorder. "there garbage traffic weed out" should take few moments if garbage. part of system being tested , if deleted web test correctly simulate real activity on website being tested?
Comments
Post a Comment