web test LoadRunner error_list

上一篇 / 下一篇  2014-05-09 12:17:19

http://bbs.51testing.com/thread-8644-1-1.html

  sckOutOfMemory 7 内存不足 
  sckInvalidPropertyValue 380 属性值不效 
  sckGetNotSupported 394 属性不可读 
  sckGetNotSupported 383 属性是只读的 
  sckBadState 40006 所请求的事务或请求本身的错误协议或者错误连接状态 
  sckInvalidArg 40014 传递给函数的参数格式不确定,或者不在指定范围内 
  sckSuccess 40017 成功 
  sckUnsupported 40018 不支持的变量类型 
  sckInvalidOp 40020 在当前状态下的无效操作 
  sckOutOfRange 40021 参数越界 
  sckWrongProtocol 40026 所请求的事务或请求本身的错误协议 
  sckOpCanceled 10004 取消操作 
  sckInvalidArgument 10014 所请求的地址是广播地址,但未设置标记 
  sckWouldBlock 10035 套接字不成块,而指定操作将使之成块 
  sckInProgress 10036 制造块的Winsock操作在进行之中 
  sckAlreadyComplete 10037 完成操作。未进行制作块的操作 
  sckNotSocket 10038 描述符不是套接字 
  sckMsgTooBig 10040 数据太大,不适于缓冲区的要求,因而被截断 
  sckPortNotSupported 10043 不支持指定的端口 
  sckAddressInUse 10048 地址在使用中 
  sckAddressNotAvailable 10049 来自本地机器的不可用地址 
  sckNetworkSubsystemFailed 10050 网络子系统失败 
  sckNetworkUnreachable 10051 当前不能从主机到达网络 
  sckNetReset 10052 在设置SO_KEEPALIVE时连接超时 
  sckConnectAborted 10053 由于超时或者其它失败而中止接连 
  sckConnectionReset 10054 通过远端重新设置连接 
  sckNoBufferSpace 10055 没有可用的缓存空间 
  sckAlreadyConnected 10056 已连接的套接字 
  sckNotConnected 10057 未接连套接字 
  sckSockedShutdown 10058 已关闭套接字 
  sckTimedout 10060 套接字超时 
  sckConnectionRefused 10061 强行拒绝连接 
  sckNotInitialized 10093 套接字没有初始化 
  sckHostNotFound 11001 授权应答:未找到主机 
  sckHostNotFoundTryAgain 11002 非授权应答:未找到主机,重试 
  sckNonRecoverableError 11003 不可恢复的错误 
  sckNoData 11004 无效名,对所请求的类型无数据记录

 

 

问题描述   :lr11 BUG?Failed to send data by channels - post message failed.

解决方法 :http://bbs.51testing.com/thread-527804-1-1.html

HTTP协议的,windows server 2008+lr11+IE7 应该没啥特殊操作,也不是每次跑都出现这个错误,之前也跑过8小时疲劳也正常出结果。
网上搜了一圈,看到个建议把controller中的Diagnotics-configure-Web Page Diagnotics默认的Enable关掉,重新试了几次倒是正常了,现在也不确定是不是真的没问题了。
估计是兼容性的问题吧

 

问题描述 :Error -27257: Pending web_reg_save_param/reg_find/create_html_param[_ex] request(s) detected and reset at the end of iteration number 1

http://www.mianwww.com/html/2011/11/11898.html
解决方法:
 web_reg_save_param位置放错了,应该放到请求页面前面。

 

问题描述 : Action.c(19): Error -27796: Failed to connect to server "preprice1.suning.cn:80": [10048] Address already in use

解决方法: Try changing the registry value 
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\TcpTimedWaitDelay to 30
and HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\MaxUserPort to 65534
and rebooting the machine

http://blog.csdn.net/alix_zhou/article/details/4488809

2、HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/tcpip/Parameters/TcpTimedWaitDelay to 30
and HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/tcpip/Parameters/MaxUserPort to 65534
将TcpTimedWaitDelay to 30设置为5s或者其它,同时增加了think time,需要重启机器。

 

 

LoadRunner错误及解决方法总结

http://wenku.baidu.com/view/2879ff4e2b160b4e767fcf2f.html?from=rec&pos=0&weight=3&lastweight=1&count=5

 

 

LoadRunner SHUNRA\CloudServices

http://dax9527.blog.163.com/blog/static/3764789520100136832542/

在某次重启以后突然发现公司的机器不能上网了,主要症状是无法获取IP,手动指定IP也不起作用,域用户下也没法联网.域防火墙无法连接.系统设备中有一个网卡带叹号,不能正常工作也没法卸载掉.
      经过半天折腾,结果无意中发现本地连接属性中有一个叫SHUNRA\Cloud WAN Emulator的服务是勾选状态.
嘿,这东西跟那个带叹号的网卡是一个名字啊,后来明白这是因为我安装了LoadRunner8.0工业级压力测试软件的原因,LR自动安装并启用了这个服务,不过却是个阉割的东西,导致不能接入到局域网.去掉勾选,完美解决.

 

LoadRunner小技巧集锦

http://www.cnblogs.com/preftest/archive/2010/08/02/1790569.html

 

1、录制脚本中包含中文,出现乱码怎么办?

把录制选项中的Support charset选中UTF-8

 

 

录制脚本后,切换到树视图中,打开相应的脚本页面。在右侧的PageView中录制的脚本呈现中文版式,但是当切换到Server Response中,所有的中文全部换成的乱码,如“勌缞仫訆”。

 

原因是服务器端没有把响应的编码设置为gb2312

 

在IIS中找到Web.Config文件,在<system.web>….</system.web>节加 入<globalization requestEncoding="gb2312" responseEncoding="gb2312" fileEncoding="gb2312"/>后再次录制脚本,乱码变中文。

 

2、录制到的脚本是空白的

有可能是由于录制的URL地址采用的是localhost的问题,改成分配的IP地址或127.0.0.1试试。

 

 

3、插入文本检查点步骤时,使用web_reg_find,通常TextPfx和TextSfx中会包含双引号,需要进行转义(用斜杠),例如:

 

       web_reg_find("Search=Body",

              "SaveCount=Welcome",

              "TextPfx=欢迎<a class=\"drop\" id=\"viewpro\" nMouseOver=\"showMenu(this.id)\">",

              "TextSfx=</a>",

              LAST);

 

4、使用web_image_check插入图片检查点时需要主要设置Run-Time Setting中的Enable Image and text check选项:

 

 

使用web_find函数插入文本检查点也一样要做此设置

 

5、性能测试往往需要准备大批量的数据,大批量数据的生成方法有很多种,常见的有:

       (1)编写SQL语句来插入数据

(2)使用DataFactory等专业的数据生成工具

       (3)通过LoadRunner录制回放的方式重复执行生成大批量数据

 

Tips:

使用DataFactory插入nchar数据类型的数据时会出现空值的情况,可以先修改数据库的数据类型设置,插完数据后再改回来

 

6、在录制脚本的过程中插入注释,录制后查看和理解脚本会更加方便。

 

 

7、LoadRunner回放脚本时,在浏览器显示的中文是乱码

 

解决办法(1):

首先设置Run-Time Settings – Browser – Browser Emulation – User-Agent

 

 

然后设置IE:

查看-编码-钩上“自动选择”和Unicode(UTF-8)。

 

解决办法(2):

使用lr_convert_string_encoding函数来转换编码

 

下面是一个使用的例子:

lr_convert_string_encoding(lr_eval_string("{ReplyContents}"),LR_ENC_SYSTEM_LOCALE,LR_ENC_UTF8,"ReplyMessage");

 

       web_submit_data("postreply.aspx_2",

              "Action=http://127.0.0.1/postreply.aspx?infloat=1&topicid=2&&inajax=1",

              "Method=POST",

              "EncType=multipart/form-data",

              "RecContentType=text/xml",

              "Referer=http://127.0.0.1/showtopic-2.aspx",

              "Snapshot=t9.inf",

              "Mode=HTML",

              ITEMDATA,

              "Name=iconid", "Value=0", ENDITEM,

              "Name=title", "Value=", ENDITEM,

              "Name=wysiwyg", "Value=0", ENDITEM,

              "Name=checkbox", "Value=0", ENDITEM,

              "Name=message", "Value=[localimg=180,112]1[/localimg]\r\n\r\n{ReplyMessage}", ENDITEM,

              "Name=e_mediatyperadio", "Value=on", ENDITEM,

              "Name=sl_attachdesc", "Value=", ENDITEM,

              "Name=attachid", "Value=", ENDITEM,

              "Name=attachdesc", "Value=", ENDITEM,

              "Name=localid", "Value=", ENDITEM,

              "Name=attachdesc", "Value=", ENDITEM,

              "Name=localid", "Value=1", ENDITEM,

              "Name=attachdesc", "Value=", ENDITEM,

              "Name=localid", "Value=2", ENDITEM,

              "Name=emailnotify", "Value=on", ENDITEM,

              "Name=postreplynotice", "Value=on", ENDITEM,

              "Name=postfile", "Value=", "File=Yes", ENDITEM,

              "Name=postfile", "Value=D:\\\\图片收集\\\\It's about time.JPG", "File=Yes", ENDITEM,

              "Name=postfile", "Value=", "File=Yes", ENDITEM,

              "Name=uploadallowmax", "Value=10", ENDITEM,

              "Name=uploadallowtype", "Value=jpg,gif", ENDITEM,

              "Name=thumbwidth", "Value=300", ENDITEM,

              "Name=thumbheight", "Value=250", ENDITEM,

              "Name=noinsert", "Value=0", ENDITEM,

              LAST);

 

8、可以在LR测试脚本的目录中找到参数文件,直接修改参数文件

The parameter file is stored in the script. directory as .dat file extension.  It can be opened with a simple text editor like Notepad as it is stored in pure text format.  Therefore, you can manipulate the files via the Notepad.  You can also use office applications such as Microsoft Excel or OpenOffice.org Calc to work on the file.  This greatly the amount of work required for maintaining a long list of data.

 

9、LR9.x启动VUGen时提示"Failed to connect to server"

After upgrading to LoadRunner 9.x I started getting a window popup which said "Failed to connect to server" every time I opened virtual user generator (vugen.exe).

 

 

The solution to this was to close virtual user generator and delete the [vugen.ini] file.

vugen.ini is found in the %systemroot% folder on your Windows PC (usually C:\WINDOWS or C:\WINNT).

 

Once you've deleted the file, virtual user generator will open without any issues and create a new vugen.ini file automatically.

 

 

 

10、怎样抓取有相同左右边界的动态value?

怎样抓取有相同左右边界的动态value?例如:

stateID="d7lg0ehmjkkm6uin3s4boei7oq">

stateID="cvopakp46ftsf8mh6l37ti3ubm">

stateID="bv9mja8gtgr39ddibm5t9163re">

web_reg_save_param里的ORD应该怎样设置?

 

 

 

 

ORD: Indicates the ordinal position or instance of the match. The default instance is 1. If you specify "All," it saves the parameter values in an array.

 

例子:

char outFlightParam[50]; // The name of the parameter for correlation

char outFlightParamVal[50]; // The formatted value of outFlightParam

web_reg_save_param("outFlightVal",

        "LB=outboundFlight value=", "RB=>",

        "ORD=ALL",

        "SaveLen=18",

        LAST);

 

    web_submit_form("reservations.pl",

        "Snapshot=t4.inf",

        ITEMDATA,

        "Name=depart", "Value=London", ENDITEM,

        "Name=departDate", "Value=11/20/2003", ENDITEM,

        "Name=arrive", "Value=New York", ENDITEM,

        "Name=returnDate", "Value=11/21/2003", ENDITEM,

        "Name=numPassengers", "Value=1", ENDITEM,

        "Name=roundtrip", "Value=<OFF>", ENDITEM,

        "Name=seatPref", "Value=None", ENDITEM,

        "Name=seatType", "Value=Coach", ENDITEM,

        "Name=findFlights.x", "Value=83", ENDITEM,

        "Name=findFlights.y", "Value=16", ENDITEM,

        LAST);

 

    sprintf(outFlightParam, "{outFlightVal_%s}",

        lr_eval_string("{outFlightVal_count}"));

    sprintf(outFlightParamVal, "Value=%s",

        lr_eval_string(outFlightParam));

    lr_message("The value argument is : %s", outFlightParamVal);

 

    web_submit_form("reservations.pl_2",

        "Snapshot=t5.inf",

        ITEMDATA,

        "Name=outboundFlight",outFlightParamVal, ENDITEM,

        "Name=reserveFlights.x", "Value=92", ENDITEM,

        "Name=reserveFlights.y", "Value=10", ENDITEM,

        LAST);

 

 

 

11、运行场景时提示“Step download timeout (120 seconds) has expired when downloading resource(s)”

 

vuser_init.c(12): Error -27728: Step download timeout (120 seconds) has expired when downloading non-resource(s)(出现个别,可以忽略)

vuser_init.c(12): Error -27727: Step download timeout (120 seconds) has expired when downloading resource(s). Set the "Step Timeout caused by resources is a warning" Run-Time Setting to Yes/No to have this message as a warning/error, respectively

 

 

如果觉得下载一个页面超过2分钟不是错误的话,可以在Run-Time设置中选择Preferences->Options,修改Step download timeout(sec)的时间

或者把“Step timeout caused by resources is a warning”设置为Yes,这样下载资源超时也只是作为警告,不作为错误提示,但是对于非资源的下载超时,则总是会提示错误的

 

12、用strtok函数分割字符串

需要在loadrunner里面获得“15”(下面红色高亮的部分),并做成关联参数。

//Body response 内容: <BODY><; PRE>//OK[8,7,5,15,6,5,0,4,0,3,0,3,2,0,0,0,1

 

用web_reg_save_param取出“8,7,5,15,6,5,0,4,0,3,0,3,2,0,0,0,1”这一段,然后用strtok函数切割出一个个数字,第四个数字就是要找的值

 

例如:

extern char * strtok(char * string, const char * delimiters ); // Explicit declaration

char separators[] = ",";

char * token;

lr_save_string("1,2,3,4,5,6","str");

token = (char *)strtok(lr_eval_string("{str}"), separators); // Get the first token

if (!token) {

        lr_output_message ("No tokens found in string!");

        return( -1 );

    }

while (token != NULL ) { // While valid tokens are returned

        lr_output_message ("%s", token );

        token = (char *)strtok(NULL, separators); // Get the next token

    }

 

 

 

 

13、LoadRunner没有购买webservice协议的license,只有http的,可不可以完全用http协议模拟webservice?

 

可以,参考:

http://blog.testsautomation.com/2009/01/web-services-performance-using-loadrunner/

http://blog.testsautomation.com/2009/05/validating-web-service-response-with-xpath/

 

 

 

 

14、在场景设置中不忽略思考时间,但是在查看响应时间的时候怎样让LR自动在响应时间里减去思考时间?

 

在analysis中找到了设置是否在报告中包含思考时间的地方做相应的设置即可:

 

 

 

 

 

15、LoadRunner在运行过程中停掉1半虚拟用户

 

Another issue that I’m facing from time to time is that LoadRunner stops 50% of running users without any notification, issue, error message etc. I’ve find out that it happens only when running with log level set to ‘always send a message’. Because of that, I suggest to run with log level set to ‘Send message only when error occur’.

 

 

 

16、LoadRunner录制不了任何东西

 

Sometimes LoadRunner is not recording anything while browsing using IE. I have no idea why but the fastest solution is to restart whole LR. Maybe some of you have good explanation for that?

 

 

 

 

17、测试RTMP协议应该在LoadRunner选择什么协议来录制?

 

用flex协议

 

有这几个函数可用:

flex_rtmp_connect  Connects a client to an RTMP server and sets connection options. 

flex_rtmp_disconnect  Disconnects a client from an RTMP server. 

flex_rtmp_send  Sends messages to an RTMP server. 

flex_rtmp_receive  Receives responses from an RTMP server

 

Flex can record and replay scripts involving RTMP (Real Time Messaging Protocol). In order to enable RTMP simulation, you must configure the recording options for the Flex protocol.

To enable RTMP:

1 Open the Recording Options dialog box by selecting Tools > Recording Options or clicking the Options button in the Start Recording dialog box.

2 In the Network > Port Mapping node click Options.

3 Set the Send-Receive buffer size threshold to 1500.

 

 

 

18、如何在LoadRunner中运行QTP脚本?

  1、运行准备:

  1)勾选QTP的Tools--Options--Run的"Alow other Mercury products to run tests and components"

  2)录制需要在lr中运行的QTP脚本,并且在QTP脚本中设置事务,Services.StartTransaction "start"与Services.EndTransaction "start"

  2、运行QTP脚本

  在LR中运行时选择QTP脚本,为QTP脚本存放目录下文件扩展名为.usr的文件。

  注:LR中运行QTP脚本时,只能有一个Vuser,否则将报错:

  The load generator is currently running the maximum number of Vusers of this type

 

 

 

 

19、在LR中如何忽略Socket接收数据的验证

在LR中对Socket进行性能测试时,LR会自己判断lrs_receive回来的数据的长度,而如果长度不符的话会有时间延迟的情况(这是性能测试完全不能接受的事情),如果做到这一点呢,经过反复尝试,发现一种简单的方法(用*代替具体的长度):

 

类似于将:

recv buf1 12

"Hello, Denny"

 

改为:

recv buf1 *

"Hello, Denny"

 

一切OK。

 

 

 

20、LoadRunner9.5的Controller中不能添加Apache的监控

 

 

在C:\Program Files\HP\LoadRunner\dat\online_graphs中找到online_resource_graphs.rmd文件,修改[Apache]部分中的EnableInUI为1

参考:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1274450165814+28353475&threadId=1229523

 

 

21、VB Vuser开发ADO脚本,提示“user-defined type not defined”

想在VB Vuser写入模拟数据操作的过程,然后在VB Vuser里定义了这个全局变量

Private m_Conn As ADODB.Connection '连接对象

Private m_Reco As ADODB.Recordset  '结果集

但是在VB Vuser中不识别这个对象,报出user-defined type not defined

 

 

需要在Run-Time 设置中的VBA部分把ADO的库选上

如果用VB Script虚拟用户来开发就不要,直接用CreateObject来创建ADO对象即可

 

TAG:

 

评分:0

我来说两句

日历

« 2024-04-26  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 17991
  • 日志数: 11
  • 建立时间: 2012-02-16
  • 更新时间: 2014-05-09

RSS订阅

Open Toolbar