51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1247|回复: 0
打印 上一主题 下一主题

LoadRunner:Think Time Ghost

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2006-10-25 14:11:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Description

      Think Time Assigned to web_url(); Step Even Though None Specified.


Solution

      Even though not specified, in the script code below think time was being assigned to the web_url("default.asp") step.

With think time enabled there is a 10 second pause on that step. Disabling think time allows it to go right on through immediately.

The think time can also be seen in the results analysis tool when the include think time graph filter is enabled.

Very helpful service request response:

"There are some occasions while running a script that LoadRunner will insert it's own think times. One occasion is when it gets a 401 error. Some times a server will issue a 401 error to a request that has an incorrect cookie set. LoadRunner upon getting the error will wait 10 seconds and then re request the resource. This time however the correct cookie value will be sent."

"The existence of the 401 error is required for your site to work correctly. The way it works is like this. The first time you access the particular URL, or if you are returning to the URL in a new session, the server needs to Authenticate/ Assign a session ID to you. It does this by giving you a cookie. So, you ask for the URL, the server sends you a HTTP 401 error, and in the error it sets a cookie. You then re request the URL, this time with a valid cookie set, and the server sends you the requested resource."

"Without the 401 error being returned, you couldn't have a new cookie set. Without the new cookie, you can't be granted access by the server."

"What we need to do here is get LoadRunner to make the re-request without waiting the 10 seconds. To do this, please add the following to the [Web] section of the default.cfg file in the script folder."

Retry401ThinkTime=0

"After making the change, when you run the script from VuGen, or when you incorporate it into new scenario, or delete and re add it to existing scenarios, it will no longer wait for the 10 seconds before re requesting the resource."

.....................................................
Script Code Example:

lr_start_transaction("Login");

web_set_user("{UserID}",
"{Password}",
"{DOMAIN}:{PORT}");

web_add_cookie("ASPSESSIONIDGQQGQUBK=NCGHOMICNKKDLCKEINNDDHHN; DOMAIN={DOMAIN}");

web_url("default.asp",
"URL=http://{DOMAIN}:{PORT}/{PATH}/default.asp",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);

lr_end_transaction("Login", LR_AUTO)
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-28 03:21 , Processed in 0.067432 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表