Forum Discussion
deepesh_jain
14 years agoFrequent Contributor
Hi,
You can read the xml for the test step and populate its request with the xml read from your file like below:
setXML = ""//xml read from the file in your folder
def requestSet = testRunner.testCase.getTestStepByName( "Publication Of data" );
requestSet.getProperty("request").setValue(setXML);
Once your groovy script populates the request of test step "Publication Of data", you can call this step for execution from your groovy script like below:
def validate1 = testRunner.runTestStepByName("Publication Of data") ;
If you have any assertions in the test step which fail, your test step will fail and you can check the status like below:
log.info "Validation Status = $validate1.status";
Note that, once the test step has completed execution, the control will pass back to groovy script. So If you have to run multiple requests reading from multiple files, put a for loop in your groovy script.
Let me know if this works or need anything else.
Thanks,
Deepesh Jain
You can read the xml for the test step and populate its request with the xml read from your file like below:
setXML = ""//xml read from the file in your folder
def requestSet = testRunner.testCase.getTestStepByName( "Publication Of data" );
requestSet.getProperty("request").setValue(setXML);
Once your groovy script populates the request of test step "Publication Of data", you can call this step for execution from your groovy script like below:
def validate1 = testRunner.runTestStepByName("Publication Of data") ;
If you have any assertions in the test step which fail, your test step will fail and you can check the status like below:
log.info "Validation Status = $validate1.status";
Note that, once the test step has completed execution, the control will pass back to groovy script. So If you have to run multiple requests reading from multiple files, put a for loop in your groovy script.
Let me know if this works or need anything else.
Thanks,
Deepesh Jain