<small id='JtS5YmTVs'></small> <noframes id='auldw'>

  • <tfoot id='IhoBr7'></tfoot>

      <legend id='h8FVYG1'><style id='ZsFOVh'><dir id='LO1ijY4uH'><q id='uUaX0ACvw'></q></dir></style></legend>
      <i id='UQkqzPW67'><tr id='Mq9Cw2X'><dt id='BhmtvYo2F'><q id='vUK4lEG'><span id='JriS'><b id='CgiTOQkL3p'><form id='nwPmq'><ins id='I1pt0o4E'></ins><ul id='EzYO'></ul><sub id='0XIOrm3GDT'></sub></form><legend id='jFyhW'></legend><bdo id='YQMVdvPr'><pre id='IT9U'><center id='Ogz60'></center></pre></bdo></b><th id='BAw0'></th></span></q></dt></tr></i><div id='k2GpMzA'><tfoot id='TbCJl'></tfoot><dl id='de7D2'><fieldset id='Rs5x'></fieldset></dl></div>

          <bdo id='wJlz'></bdo><ul id='RonM179rU'></ul>

          1. <li id='S5gMW'></li>
            登陆

            章鱼彩票 app-Jmeter元件(If)控制器

            admin 2019-11-01 209人围观 ,发现0个评论

            在软件测试过程中,我们会遇到这样的场景,当某个接口a返回任务或者订单号的ID时,另一个接口b需要调用a接口的任务ID或订单号,如果a接口返回的任务或者订单号的章鱼彩票 app-Jmeter元件(If)控制器ID为null时,b接口运行会报错,此时,我们就需要(If)控制章鱼彩票 app-Jmeter元件(If)控制器器来判断接口a的响应结果是否为null,来控制接口b的运行。

            首先我们看看Jmeter官网的解释:

            The If Controller allows the user to control whether the test elemen章鱼彩票 app-Jmeter元件(If)控制器ts below it (its children) are run or not.

            By default, the condition is evaluated only once on initial entry, but you have the option to have it evaluated for every runnable elemen章鱼彩票 app-Jmeter元件(If)控制器t contained in the controller.

            元件(If)控制器添加路径

            (If)控制器界面

            (If)控制器使用场景:

            - Option 1 : Use a variable that contains true or false

            If you want to test if last sample was successful, you can use

            ${JMeterThread.last_sample_ok}

            - Option 2 : Use a function (${__jexl3()} is advised) to evaluate an expression that must return true or 章鱼彩票 app-Jmeter元件(If)控制器false

            我们看看jmeter官网的例子:

            - ${__groovy(vars.get("my章鱼彩票 app-Jmeter元件(If)控制器Var") != "Invalid" )} (Groovy check myVar is not equal to Invalid)

            - ${__groovy(vars.get("myInt").toInteger() <=4 )} (Groovy check myInt is less then or equal to 4)

            - ${__groovy(vars.get("myInt").toInteger() <=4 )} (Groovy check myInt is less then or equal to 4)

            - ${__jexl3(${COUNT} < 10)}

            - ${RESULT}

            - ${JMeterThread.last_sample_o唐刀k} (check if the last sample succeeded)

            OK(If)控制器的使用我们就分享至此,谢谢!

            请关注微信公众号
            微信二维码
            不容错过
            Powered By Z-BlogPHP