-1
测试步骤在了SoapUI(专业版)Groovy脚本我有12个测试步骤:在了SoapUI
GET
要求- Groovy脚本女巫得到从以前的阶跃响应
total
值 - 属性
- 房产转让
POST
请求1POST
请求2POST
请求3POST
请求4POST
请求5POST
请求6POST
请求7POST
请求8
所有POST
请求有ID
参数。
问:
如何写这样也许另一个决策方式Groovy脚本:
if total = 8 then set ID parameters of POST 1 = 1,POST 2 = 1,POST 3 = 1,POST 4 = 1,POST 5 = 1,POST 6 = 1,POST 7 = 1,POST 8 = 1
if total = 7 then set ID parameters of POST 1 = 2,POST 2 = 1,POST 3 = 1,POST 4 = 1,POST 5 = 1,POST 6 = 1,POST 7 = 1
if total = 6 then set ID parameters of POST 1 = 2,POST 2 = 2,POST 3 = 1,POST 4 = 1,POST 5 = 1,POST 6 = 1
if total = 5 then set ID parameters of POST 1 = 2,POST 2 = 2,POST 3 = 2,POST 4 = 1,POST 5 = 1
if total = 4 then set ID parameters of POST 1 = 2,POST 2 = 2,POST 3 = 2,POST 4 = 2
if total = 3 then set ID parameters of POST 1 = 3,POST 2 = 3,POST 3 = 2
if total = 2 then set ID parameters of POST 1 = 4,POST 2 = 4
if total = 1 then set ID parameters of POST 1 = 8
你的剧本结果每次都不一样,大致看起来像这样 - 我@@ 3bb633cd或者@ @ 52c6035或者@ @ 47a007e77等等 –
哦。我改变了一些东西和工作。谢谢。我将testRunner.testCase.setPropertyValue(“IdForPost _”+(idx + 1),numString)更改为testRunner.testCase.getTestStepByName(“Properties”)。setPropertyValue(“IdForPost”+(idx + 1),numString) –
Nicee :) ..你能将它标记为已接受吗? - 谢谢 –