-1
soap uiプロジェクト全体で特定の文字列を使ってテストステップを無効にしようとしています。soapuiでgroovyを使用して部分名でテストステップを見つけよう
私のsoapuiプロジェクトで 'WSDLCall'という文字列を含むテストステップを見つけて無効にするにはどうすればいいですか?
soap uiプロジェクト全体で特定の文字列を使ってテストステップを無効にしようとしています。soapuiでgroovyを使用して部分名でテストステップを見つけよう
私のsoapuiプロジェクトで 'WSDLCall'という文字列を含むテストステップを見つけて無効にするにはどうすればいいですか?
ここでは、あなたが必要としているのは、のgroovyスクリプトです。
したがって、テスト手順を無効にする同じプロジェクトに、Groovyスクリプトテストステップを追加します。スクリプトのコメントを適切に見つけることができます。
/**
* this groovy script disables all the test steps
* whose name contains the string specified in the
* variable 'stepNamePatternToDisable'
**/
//You may change the pattern required
def stepNamePatternToDisable = 'WSDLCall'
//Get the project object
def project = context.testCase.testSuite.project
//Loop thru the suite lise
project.testSuiteList.each { suite ->
//Loop thru the case list
suite.testCaseList.each { caze ->
//Loop thru the step list of the specific case
caze.testStepList.each { step ->
//if step name contains the given pattern, then disable, enable otherwise.
if (step.name.contains(stepNamePatternToDisable)) {
step.disabled = true
} else {
step.disabled = false
}
}
}
}