Forum Discussion
Federal_Home_Lo_1
14 years agoOccasional Contributor
As I look through the code, I am thinking if threading may be an issue with the groovy script? In my project, I have
1. getFinalRate test step that calls a web service.
2. Our server responds back with a backendreference number. The result of the web service is parsed to get a reference number for future processing as follows
// get response property
def response = testRunner.testCase.getTestStepByName( "getFinalRate" );
def root = response.getProperty( "response" );
// parsing
def node = new groovy.util.XmlParser(false,false).parseText(root.value);
def accountNumberNode = node["env:Body"]["getFinalRateResponse"]["BackendReferenceNumber"];
log.info(accountNumberNode.text());
context.backendNumber = accountNumberNode.text();
3. As you suggested, I used the backendNumber to query/match the response of the updateManualrateResponse step. (I also went to the mockservice in 1link_manualupdate project and put the same query/match condition.
xpath query=declare namespace ws='http://ws.advances.pso.s1.com/';
//ws:updateManualRate[1]/manualRateRq[1]/backendReferenceNumber[1]
Matching value=${backendNumber}
I am wondering if the groovy script that parses the response is threadsafe and if the fact that the backendreference numbers are getting mixed may have something to do with this issue?
Your thoughts?
1. getFinalRate test step that calls a web service.
2. Our server responds back with a backendreference number. The result of the web service is parsed to get a reference number for future processing as follows
// get response property
def response = testRunner.testCase.getTestStepByName( "getFinalRate" );
def root = response.getProperty( "response" );
// parsing
def node = new groovy.util.XmlParser(false,false).parseText(root.value);
def accountNumberNode = node["env:Body"]["getFinalRateResponse"]["BackendReferenceNumber"];
log.info(accountNumberNode.text());
context.backendNumber = accountNumberNode.text();
3. As you suggested, I used the backendNumber to query/match the response of the updateManualrateResponse step. (I also went to the mockservice in 1link_manualupdate project and put the same query/match condition.
xpath query=declare namespace ws='http://ws.advances.pso.s1.com/';
//ws:updateManualRate[1]/manualRateRq[1]/backendReferenceNumber[1]
Matching value=${backendNumber}
I am wondering if the groovy script that parses the response is threadsafe and if the fact that the backendreference numbers are getting mixed may have something to do with this issue?
Your thoughts?