12 years ago
Can we call gotoStepByName("teststepname") from teardown scr
Hi,
I want to execute a testcase with more than one set of test data. so i kept all the test case in xls. I thought of use setup script and tear down script of testcase for iterate and calling the teststep.
In SETUP SCRIPT testcase,
ArrayList<ArrayList<NameValuePair>>testdata =getTCTestData(sDataSheetName,projectdir,TestCaseName, sheetName);
context.setProperty("testdata", testdata)
testRunner.testCase.setPropertyValue("Pointer", "1")
ArrayList<NameValuePair> nv = testdata.get(0);
for (NameValuePair nvp : nv) {
String prop = nvp.getName();
String value = nvp.getValue();
testCase.properties["${prop}"].value = value
}
}
In TEARDOWN SCRIPT,
//Set the testdata values in testcase custom properties
ArrayList<NameValuePair> nv = testdata.get(pointer);
for (NameValuePair nvp : nv) {
String prop = nvp.getName();
String value = nvp.getValue();
testCase.properties["${prop}"].value = value
}
pointer = pointer+1
testRunner.testCase.setPropertyValue("pointer", pointer.toString())
testRunner.gotoStepByName("teststep request")
log.info("end of else loop")
After setting the next row test data in xls sheet, i tried to call gotoStepByName(). I am not getting any responses for this call. I even checked the error log and soapui log. I didnt get any error for this script.
Is there any other way to loop/call the teststep from teardown script?
Please help me in fixing this issue.
Thank you
I want to execute a testcase with more than one set of test data. so i kept all the test case in xls. I thought of use setup script and tear down script of testcase for iterate and calling the teststep.
In SETUP SCRIPT testcase,
ArrayList<ArrayList<NameValuePair>>testdata =getTCTestData(sDataSheetName,projectdir,TestCaseName, sheetName);
context.setProperty("testdata", testdata)
testRunner.testCase.setPropertyValue("Pointer", "1")
ArrayList<NameValuePair> nv = testdata.get(0);
for (NameValuePair nvp : nv) {
String prop = nvp.getName();
String value = nvp.getValue();
testCase.properties["${prop}"].value = value
}
}
In TEARDOWN SCRIPT,
//Set the testdata values in testcase custom properties
ArrayList<NameValuePair> nv = testdata.get(pointer);
for (NameValuePair nvp : nv) {
String prop = nvp.getName();
String value = nvp.getValue();
testCase.properties["${prop}"].value = value
}
pointer = pointer+1
testRunner.testCase.setPropertyValue("pointer", pointer.toString())
testRunner.gotoStepByName("teststep request")
log.info("end of else loop")
After setting the next row test data in xls sheet, i tried to call gotoStepByName(). I am not getting any responses for this call. I even checked the error log and soapui log. I didnt get any error for this script.
Is there any other way to loop/call the teststep from teardown script?
Please help me in fixing this issue.
Thank you