在Loadrunner中设置wininet的超时

时间:2017-07-07 04:42:49

标签: loadrunner wininet

这个问题适用于必须在loadrunner中使用WinInet重放引擎的时候。响应时间超过30秒时,会观察到超时错误。默认情况下,wininet的超时设置为30秒。有一种方法可以让它重试请求,但在我的情况下,它是一个帖子请求,重试不是一个现实的案例。 遇到的错误是 -

Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="https

RTS的屏幕截图:

enter image description here

有没有办法将超时配置为更高的值以及在何处执行此操作?

LR12.53,Windows server 2008

新信息

为了演示上述行为,我创建了一个Web应用程序,它需要超过30秒才能响应GET请求。我还在Loadrunner的运行时设置中启用了WinInet重放,如上图所示。

脚本的行动

Action()
{
lr_start_transaction("slow_transaction");

web_custom_request("slow_transaction",
    "URL=http://localhost:8887/slow_response",
    "Method=GET",
    "TargetFrame=",
    "Resource=0",
    "Referer=",
    "Mode=HTML",
    "Body=",
    LAST);

lr_end_transaction("slow_transaction", LR_AUTO);

return 0;
}

使用高级跟踪执行上述脚本时,我可以看到以下日志。观察到的错误是Action.c(6): Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="http://localhost:8887/slow_response" [MsgId: MERR-27492]

Action.c(4): Notify: Transaction "slow_transaction" started.
Action.c(6): web_custom_request("slow_transaction") started     [MsgId: MMSG-26355]
Action.c(6): DETECTING_PROXY" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
Action.c(6): RESOLVING_NAME" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
Action.c(6): NAME_RESOLVED" on behalf of "URL="http://localhost:8887/slow_response"     [MsgId: MMSG-27397]
Action.c(6): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
Action.c(6): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
Action.c(6): CONNECTED_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
Action.c(6): SENDING_REQUEST" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
Action.c(6): REQUEST_SENT" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
Action.c(6): RECEIVING_RESPONSE" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
Action.c(6): CLOSING_CONNECTION" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
Action.c(6): CONNECTION_CLOSED" on behalf of "URL="http://localhost:8887/slow_response"     [MsgId: MMSG-27397]
Action.c(6): REQUEST_COMPLETE" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
Action.c(6): Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for URL="http://localhost:8887/slow_response"    [MsgId: MERR-27492]
Action.c(6): HANDLE_CLOSING" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
Action.c(6): web_custom_request("slow_transaction") highest severity level was "ERROR", 0 body bytes, 0 header bytes    [MsgId: MMSG-26388]
Action.c(6): Notify: Transaction "slow_transaction" ended with a "Fail" status (Duration: 31.1355 Wasted Time: 0.1075).

现在在脚本中使用web_set_max_retries("2");设置重试时,我们可以在日志中清楚地看到它在响应未到达的某个时间后重试它但是这也会因为它的新请求而失败将再次花费超过30秒;)

重试日志:

Action.c(7): CLOSING_CONNECTION" on behalf of "URL="http://localhost:8887/slow_response"    [MsgId: MMSG-27397]
Action.c(7): CONNECTION_CLOSED" on behalf of "URL="http://localhost:8887/slow_response"     [MsgId: MMSG-27397]
Action.c(7): REQUEST_COMPLETE" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
Action.c(7): Attempting "HttpSendRequest" retry due to Windows error code=12002 for URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27491]
Action.c(7): DETECTING_PROXY" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]
Action.c(7): CONNECTING_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"      [MsgId: MMSG-27397]
Action.c(7): CONNECTED_TO_SERVER" on behalf of "URL="http://localhost:8887/slow_response"   [MsgId: MMSG-27397]

现在我们有大约30秒后WinInet重试的证据。我是否可以请求HP支持或其他LR专家,WinInet专家建议是否有办法增加WinInet的超时时间以及如何?

4 个答案:

答案 0 :(得分:1)

我也遇到了和你一样的问题。 由于使用Wininet replay,所有运行时设置都不会影响运行测试。

我们必须通过转到将 Wininet 注册表设置为允许超时超过 30 秒

<块引用>

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet 设置

添加新的 DWORD 键和值(我设置为 10 分钟)

<块引用>
  • 键:ReceiveTimeout
  • 值:600000

答案 1 :(得分:0)

Actualy,WinInet重放引擎与在运行时设置中设置超时参数无关。

您需要更改2个地方:

  1. 运行时设置&gt;网络协议&gt;偏好&gt;一般&gt; “步骤下载超时”:
  2. enter image description here

    1. 运行时设置&gt;网络协议&gt;偏好&gt; HTTP&gt; “HTTP request connect timeout”,“HTTP request receive timeout”和“HTTP Keep Alive timeout”:
    2. enter image description here

答案 2 :(得分:0)

您正在连接到本地主机,即同一台计算机。您不应该通过代理发送项目以进行本地计算机连接。关闭所有代理设置。

接下来,您使用的是本地计算机。这使得网络成本为零,因为您只需在堆栈底部弹回并备份,从不点击网络接口卡也不退出框。这意味着超时显然与网络无关,并且必须是本地计算机上目标服务的配置问题。

当您登录到Localhost并且您要连接到localhost时,任何执行的安全上下文都应该是您登录localhost的凭据。我仍然没有看到这是代码中的Windows集成身份验证问题,但如果它是,并且您的目标服务与Windows安全上下文完全集成,那么请考虑您可能需要一些带有安全凭据信息的头字段。

答案 3 :(得分:0)

这与所有WINDOWS机器有关。按“Windows+R”,这将打开运行窗口。输入“regedit.exe。点击HKEY_CURRENT_USER

展开并到达:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSetting

在编辑菜单上,转到新建,然后单击 DWORD 值。

输入 KeepAliveTimeout,然后按 ENTER。

按照步骤 2

输入 ReceiveTimeout,然后按 ENTER。

按照第 2 步输入 SendTimeout,然后按 ENTER。

在“编辑”菜单上,单击“修改”。

输入超时值(以毫秒为单位),然后单击“确定”。例如,要将超时值设置为一分钟,请输入 60000。重新启动机器。

您也可以参考此处了解更多详情 - wininet replay fail

相关问题