2016-07-18 10 views

答えて

1

ここでは、あなたが必要としているのは、の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 
      } 
     } 
    } 
} 
関連する問題