简体   繁体   English

有没有一种方法可以通过Xpath切换到JMeter脚本来运行脚本的一部分

[英]Is there a way to run portion of script by toggling via Xpath to JMeter script

Is there a way to run portion of script by toggling via Xpathto JMeter script like as below 是否可以通过Xpathto JMeter脚本进行切换来运行脚本的一部分,如下所示

*/[@testname="...." and @enabled="true"]

I know from the GUI we can do, by adding the If controller for the samplers which we would like turn off .For ex: ${Enter_shift_hours} == ${ToTurnOff_EnterShiftHours} 我从GUI知道,我们可以通过添加要关闭的采样器的If控制器来做到。例如: ${Enter_shift_hours} == ${ToTurnOff_EnterShiftHours}

But If want to turn Off and On multiple actions , either i have to move under one If controller or create bunch of controllers to the associated ,so instead of going back and fourth to GUI script and update it ,Is there any way to toggle via Xpath to JMeter script. 但是,如果要关闭和打开多个动作,要么我必须移动到一个If控制器下,要么创建一堆控制器到相关联,所以不必返回并第四次返回GUI脚本并对其进行更新,是否有任何方法可以通过JMeter脚本的Xpath。

Let's say Transaction Controller name is : TimeCardSave_SelectProject and the Transaction has bunch of samplers TimeCardSave_SelectProject_${URL} .Now i would like to turn off the these samplers by toggling into JMX/XML script via Xpath 假设Transaction Controller的名称为:TimeCardSave_SelectProject,而Transaction具有一堆采样器TimeCardSave_SelectProject _ $ {URL}。现在,我想通过Xpath切换到JMX / XML脚本来关闭这些采样器

在此处输入图片说明

在此处输入图片说明

Thanks, Raj 谢谢,拉杰

The easiest way is using Taurus tool as a wrapper for your JMeter test, it provides simple way of enabling/disabling certain sections of the test using simple YAML syntax 最简单的方法是将Taurus工具用作JMeter测试的包装,它提供了使用简单的YAML语法启用/禁用测试某些部分的简单方法

---
execution:
  scenario:
    script: test.jmx
    modifications:
      disable:  # Names of the tree elements to disable
      - TimeCardSave_SelectProject_${URL}

More information: Taurus: A New Star in the Test Automation Tools Constellation 更多信息: Taurus:测试自动化工具星座中的新星

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM