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

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

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

51Testing软件测试网$\r$Dl"Ko6?&W.fcdk

文章来源:http://www.51testing.com/html/79/n-20479.html51Testing软件测试网O#i9XltA4c

gt e9`vO0P{0录制选项:
%t ~ \b1e7i0        在Recording Options窗口中的HTTP Properties-Advanced标签页,Recoding schemes中,有几个高级录制选项:51Testing软件测试网yn6Y+\4S$O!D$EW7w Y
        Headers:自动录制http头,默认是不录制headers。比如在另一篇文章Web测试中容易被忽略的Charset问题中提到的Http ContentType中的Charset问题,就可以通过在这里设置自动完成。录制后会在脚本中自动添加web_add_auto_header的语句。51Testing软件测试网$qk O7F_;KY
        Contect Types:通过一些过滤,设置录制脚本中包含的内容,默认是不做任何过滤。应用意义:在我的测试系统中,当客户端首次登录时会下载一些资源文件如js、gif等并保存在缓存中,在一定时间内客户端再次访问时不会再下载这些资源,因此,录制测试脚本时可以通过这个设置来屏蔽对某种类型的资源的录制。
o/P,E$DA0        Non-Resources:把某些类型的url设置为“非资源”,该设置在脚本中的体现是web_url中的Resource属性是0或1。具体应用意义下面说明。

4jn([g}0

\KF/m pBOuD M0Runtime选项:51Testing软件测试网8q;s"Gqa8t0m7u[
        在ContentCheck中定制检查规则,回放是LR可以自动匹配该规则,当满足条件时设置测试通过或失败。51Testing软件测试网7iL Q"q t iSK6yi
        比如我们测试一个web应用,当服务器返回Http 404、302等结果时,LR能够根据这些http status判断请求成功或失败。但如果http返回的状态是正常的,但我们的业务逻辑出错,系统返回的错误LR是无法识别的,那么可以通过在这里设置检 验规则,当满足规则时认为时成功或失败。

v6n&F3B7a/h!k0

(nj)YzwW:F0        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)的影响,在需要时 也会解析它。

8O ~(}TR0

)m%Q)^|@h`0        下面是帮助中的一些说明。51Testing软件测试网V)_S G`2Gs
Specifying Non-Resource Content Types51Testing软件测试网Le0|l|rB~6r
When 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.51Testing软件测试网M~!lH!ps

51Testing软件测试网A(IzxAF7w^4v

Non-critical item errors as warnings.51Testing软件测试网;WU\#B8N~ `
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.51Testing软件测试网 @K K'N#P.qQX7PW2g

fO,o _IXdQ0Download non-HTML resources
$F4F T*?!p$Y[P:k|*[0Instructs 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.51Testing软件测试网/m'hH2@|


TAG:

 

评分:0

我来说两句

Open Toolbar