在LoadRunner脚本中处理HTTP重定向
?
參考:
Handle HTTP Re-Directions in LoadRunner Scripts yourself
http://ptfrontline.wordpress.com/2010/04/11/handle-http-re-directions-in-loadrunner-scripts-yourself/
?
Action()?
{?
??? int HttpRetCode=0;?
??
??? // Set redirection depth to 0?
??? web_set_option("MaxRedirectionDepth", "0", LAST);?
??
??? // Initial Location where we want to go?
??? lr_save_string("http://www.mercury.com", "Location");?
??
??? do
??? {?
??????? // Save new Redirection Info (Location: header)?
??????? web_reg_save_param("Location",?
?????????????????????????? "LB=Location: ",?
?????????????????????????? "RB=\r\n",?
?????????????????????????? "Ord=1",?
?????????????????????????? "NotFound=Warning",?
?????????????????????????? "Search=Headers",?
?????????????????????????? LAST );?
??
??????? // do any web call (This needs to be modified to suit your needs)?
??????? web_url("my_req",?
????????? "URL={Location}",?
????????? LAST );?
??
??????? // Get HTTP response Code?
??????? HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);?
??
??? } while ((HttpRetCode>=300) & (HttpRetCode<400));?
??
??? return 0;?
}
?
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/preftest/archive/2010/08/02/1790575.html
總結(jié)
以上是生活随笔為你收集整理的在LoadRunner脚本中处理HTTP重定向的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 打新股中签后能赚多少钱 不同股票赚的不一
- 下一篇: SQL Server 2000 sp4