JMeter嵌入式资源下载属性

时间:2012-10-26 12:54:26

标签: jmeter

是否可以设置全局属性以自动从JMeter中的html文件中检索所有嵌入资源。我知道我们可以在计划中的Http请求和Http Request Defaults中检查/取消选中此项,但在.properties文件中是否有类似的选项。

另外,如果我检查Http Request Defaults元素上的选项,如何在计划中为单个Http请求禁用它?

2 个答案:

答案 0 :(得分:2)

从2.8开始,目前尚无法提出增强请求:

关于第二个问题,答案就在这里:

见注释:

   Note: radio buttons only have two states - on or off. This makes it impossible to
   override settings consistently - does off mean off, or does it mean use the current 
   default? JMeter uses the latter (otherwise defaults would not work at all). So if    
   the button is off, then a later element can set it on, but if the button is on, a 
   later element cannot set it off.

答案 1 :(得分:0)

您可以通过将脚本代码设置为javascript语言,将BSF PreProcessor添加到覆盖默认配置的HTTP Sampler

 sampler.setProperty("HTTPSampler.image_parser",${LOAD_ALL_PAGE_RESOURCES},false);

其中LOAD_ALL_PAGE_RESOURCES是用户定义的变量

如果您将此BSF PreProcessor设置为Thread Group,则该值对其中定义的所有Http Sampler都有效。

如此链接所述: http://www.havecomputerwillcode.com/blog/?p=543