KrishnaReddy_YV
16 years agoNew Contributor
Need to run the test cases for multiple times.
Hi Ole,
I'm getting Socket exception while invoking the java based web services and aslo while executing the test cases thorugh SOAP UI. The exact exception I'm getting is "Error getting response; java.net.SocketException: Software caused connection abort: recv failed" and giving the blank response. But if I tried by invoking the same service for multiple times, let say 3 or 4 times I'm able to get the response. So becase of this exception all of my automated test cases are failing. But as per requirement I need to pass the test cases for the for the first attempt, since automated test cases are not running multiple times to get response.
So finally I tried to write a groovy script which intends to run the test scripts for 5 times untill it get response. But the problem in my code is that it is not able to run the test cases for multiple times.
So, could you please give me the hint that where I can modify the below code to run the test case for multiple times until I get the response.
The code I tried to execute is as folows -
def openrequest = testRunner.testCase.getTestStepByName( "getCasesBySubject - Request Transformation Failure -101" );
def property = openrequest.getProperty( "response" );
def count = 0;
while(count <10 && property.value == null){
testRunner.gotoStepByName( "getCasesBySubject - Request Transformation Failure -101" );
count ++;
}
Many Thanks,
Krish
I'm getting Socket exception while invoking the java based web services and aslo while executing the test cases thorugh SOAP UI. The exact exception I'm getting is "Error getting response; java.net.SocketException: Software caused connection abort: recv failed" and giving the blank response. But if I tried by invoking the same service for multiple times, let say 3 or 4 times I'm able to get the response. So becase of this exception all of my automated test cases are failing. But as per requirement I need to pass the test cases for the for the first attempt, since automated test cases are not running multiple times to get response.
So finally I tried to write a groovy script which intends to run the test scripts for 5 times untill it get response. But the problem in my code is that it is not able to run the test cases for multiple times.
So, could you please give me the hint that where I can modify the below code to run the test case for multiple times until I get the response.
The code I tried to execute is as folows -
def openrequest = testRunner.testCase.getTestStepByName( "getCasesBySubject - Request Transformation Failure -101" );
def property = openrequest.getProperty( "response" );
def count = 0;
while(count <10 && property.value == null){
testRunner.gotoStepByName( "getCasesBySubject - Request Transformation Failure -101" );
count ++;
}
Many Thanks,
Krish