Forum Discussion
latiffsyed
12 years agoNew Contributor
Hi,
Can any one help me plz. I have a assertion with name (xxx) in a test step (yyy) in all testcases under all test suites of a project. I am trying to remove all assertions with name(xxx) from all the test steps (yyy) in all test cases. I have seen above posts the following script can remove assertions in test case level but not project level.
def assertionsList = testRunner.getTestCase().getTestStepByName("Test Request").getAssertionList()
for( e in assertionsList){
testRunner.getTestCase().getTestStepByName("Test Request").removeAssertion(e)
}
I have developed till here but not getting success
def hMap_projectTestSuiteList = testRunner.testCase.testSuite.project.getTestSuiteList();
def targetList = hMap_projectTestSuiteList;
def testCaseList;
def testStepList;
// iterate testSuites
for( obj_testSuite in targetList) {
log.info( "testSuite = " + obj_testSuite.getName() );
testCaseList = obj_testSuite.getTestCaseList()
// iterate testCases
for( obj_testCase in testCaseList) {
log.info( "testCase = " + obj_testCase.getName() );
testStepList = obj_testCase.getTestStepList();
//get testStep list to disable
for( obj_testStep in testStepList){
if( obj_testStep.getModelItem().getClass().toString() == "class com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep" )
if (obj_testStep.getName() == "XXXXXXXXXX"){
//log.info( " --------- obj = " + obj_testStep.getModelItem().getClass().toString() + " --- ");
def assertionsList = testRunner.getTestCase().getTestStepByName(obj_testStep.getName()).getAssertionList()
for( e in assertionsList){
testRunner.getTestCase().getTestStepByName(obj_testStep.getName()).removeAssertion(e)
}
}
}
}
}
Thanks,
Latiff.
Can any one help me plz. I have a assertion with name (xxx) in a test step (yyy) in all testcases under all test suites of a project. I am trying to remove all assertions with name(xxx) from all the test steps (yyy) in all test cases. I have seen above posts the following script can remove assertions in test case level but not project level.
def assertionsList = testRunner.getTestCase().getTestStepByName("Test Request").getAssertionList()
for( e in assertionsList){
testRunner.getTestCase().getTestStepByName("Test Request").removeAssertion(e)
}
I have developed till here but not getting success
def hMap_projectTestSuiteList = testRunner.testCase.testSuite.project.getTestSuiteList();
def targetList = hMap_projectTestSuiteList;
def testCaseList;
def testStepList;
// iterate testSuites
for( obj_testSuite in targetList) {
log.info( "testSuite = " + obj_testSuite.getName() );
testCaseList = obj_testSuite.getTestCaseList()
// iterate testCases
for( obj_testCase in testCaseList) {
log.info( "testCase = " + obj_testCase.getName() );
testStepList = obj_testCase.getTestStepList();
//get testStep list to disable
for( obj_testStep in testStepList){
if( obj_testStep.getModelItem().getClass().toString() == "class com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep" )
if (obj_testStep.getName() == "XXXXXXXXXX"){
//log.info( " --------- obj = " + obj_testStep.getModelItem().getClass().toString() + " --- ");
def assertionsList = testRunner.getTestCase().getTestStepByName(obj_testStep.getName()).getAssertionList()
for( e in assertionsList){
testRunner.getTestCase().getTestStepByName(obj_testStep.getName()).removeAssertion(e)
}
}
}
}
}
Thanks,
Latiff.
Related Content
- 12 years ago
- 3 years ago
Recent Discussions
- 2 days ago