-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 :) ..你能將它標記爲已接受嗎? - 謝謝 –