度过了一个冬眠,在春末夏初之际,补充自己的营养,努力学习,努力工作!

LoadRunner HTTP协议中几个有用的选项(转载)

上一篇 / 下一篇  2011-07-01 18:02:04 / 个人分类:LR文档

(k,}/wLEa0文章来源:http://www.51testing.com/html/79/n-20479.html51Testing软件测试网;N K9t:O1qp$w'n+eF

z.x8ei-p)C ^&k0录制选项:51Testing软件测试网*yF;O/uq%S$H E(n
        在Recording Options窗口中的HTTP Properties-Advanced标签页,Recoding schemes中,有几个高级录制选项:
,t4D9Fr3LQ-b!Q[-H0        Headers:自动录制http头,默认是不录制headers。比如在另一篇文章Web测试中容易被忽略的Charset问题中提到的Http ContentType中的Charset问题,就可以通过在这里设置自动完成。录制后会在脚本中自动添加web_add_auto_header的语句。
)})z4o(p xH5Bi0        Contect Types:通过一些过滤,设置录制脚本中包含的内容,默认是不做任何过滤。应用意义:在我的测试系统中,当客户端首次登录时会下载一些资源文件如js、gif等并保存在缓存中,在一定时间内客户端再次访问时不会再下载这些资源,因此,录制测试脚本时可以通过这个设置来屏蔽对某种类型的资源的录制。51Testing软件测试网Ww$b5Z$P
        Non-Resources:把某些类型的url设置为“非资源”,该设置在脚本中的体现是web_url中的Resource属性是0或1。具体应用意义下面说明。

i#h-e @:[VMR#[4S0

r2S:[-@v DR0Runtime选项:51Testing软件测试网a(s7E(pz i
        在ContentCheck中定制检查规则,回放是LR可以自动匹配该规则,当满足条件时设置测试通过或失败。
O6a*^[,Q*_9~0        比如我们测试一个web应用,当服务器返回Http 404、302等结果时,LR能够根据这些http status判断请求成功或失败。但如果http返回的状态是正常的,但我们的业务逻辑出错,系统返回的错误LR是无法识别的,那么可以通过在这里设置检 验规则,当满足规则时认为时成功或失败。
51Testing软件测试网l/S2K$N(H1G)i~G5n

51Testing软件测试网/|#G2` f`-l`:f

        Resource:指示URL是否属于资源。1 是;0 不是。设置了这个参数后,RecContentType参数被忽略。“Resource=1”,意味着当前操作与所在脚本的成功与否关系不大。在下载资源 时如果发生错误,可以当作警告而不是错误来处理的(RTS中的Non-critical resource errors as warnings);URL是否被下载受“Run-Time Setting—Browser Emulation--Download non-HTML resources” 这个选项的影响。此操作的响应信息是不做为HTML来解析的。“Resource=0”,表明此URL是重要的,不受发送请求(RTS)的影响,在需要时 也会解析它。

{\ib8f!UX0

#L?-U,]q J/t5b0[0        下面是帮助中的一些说明。51Testing软件测试网sTAAXc}4g0o
Specifying Non-Resource Content Types
bx3N A3P0When you record a script, VuGen indicates whether or not it will retrieve the resource during replay using the Resource attribute in the web_url function. If the Resource attribute is set to 0, the resource is retrieved during script. execution. If the Resource attribute is set to 1, the Vuser skips the resource type.

^n-S,V(\ P(l;x!N051Testing软件测试网D({Azu NX

Non-critical item errors as warnings.51Testing软件测试网%Fh6cy3Y-U
This option returns a warning status for a function which failed on an item that is not critical for load testing, such as an image or Java applet that failed to download. This option is enabled by default. If you want a certain warning to be considered an error and fail yourtest, you can disable this option. You can set a content-type to be critical by adding it to the list of Non-Resources. For more information, see Specifying Non-Resource Content Types.

!z _y:[.w5C051Testing软件测试网GDlT}

Download non-HTML resources51Testing软件测试网4t+WJ)o"q
Instructs Vusers to load graphic images when accessing a Web page during replay. This includes both graphic images that were recorded with the page, and those which were not explicitly recorded along with the page. When real users access a Web page, they wait for the images to load. Therefore, enable this option if you are trying to test the entire system, including end-user time (enabled by default). To increase performance and not emulate real users, disable this option.

2doP#a W:p0

TAG:

 

评分:0

我来说两句

Open Toolbar