|
想对网站进行并发测试,但是由于登陆后会产生sessionid,需要动态去取,用LR设置关联函数后一直无法捕获sid
url类型为:http://www.test.com/test/?sid=XXXXXXXXXXXXX(X为随机生成的SESSIONID)
就是需要捕获这段sid,用于后续的操作,代码如下- Action()
- {
- int web_get_int_property(const int HttpInfoType);
-
- int HttpRetCode;
- web_submit_data("login.ajax.class.php",
- "Action=http://www.test.com/login.ajax.class.php",
- "Method=POST",
- "RecContentType=text/html",
- "Referer=http://www.test.com/",
- "Snapshot=t3.inf",
- "Mode=HTML",
- ITEMDATA,
- "Name=op", "Value=test", ENDITEM,
- "Name=username", "Value=545hbdh00917", ENDITEM,
- "Name=password", "Value=111111", ENDITEM,
- LAST);
- web_reg_save_param("sid",
- "LB/BIN=http://www.test.com/test/?sid=",
- "RB/BIN=""",
- "NOTFOUND=warning",
- "Search=all",
- LAST);
- HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
- web_custom_request("test",
- "Method=get",
- "Url=http://www.test.com/test/",
- LAST);
- return 0;
- }
复制代码 |
|