header
header
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome, Guest. Please login or register.
December 01, 2008, 07:43:13 pm
Username: Password:
Login with username, password and session length

Forgot your password?
 
Need to run the test cases for multiple times.
Welcome, Guest. Please login or register.
December 01, 2008, 07:43:13 pm
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  General Category
| |-+  eviware general
| | |-+  Need to run the test cases for multiple times.
« previous next »
Pages: [1] Print
Author Topic: Need to run the test cases for multiple times.  (Read 712 times)
KrishnaReddy YV
Newbie
*
Posts: 3


« on: October 14, 2008, 03:24:04 pm »

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
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,466


« Reply #1 on: October 14, 2008, 09:42:00 pm »

Hi,

The problem is the testRunner.gotoTestStepByName method which does not actually execute that TestStep but transfer control to it once the current script finishes.. either you should use the

Code:
testRunner.runTestStep( testRunner.testCase.testSteps["getCasesBySubject - Request Transformation Failure -101"], true, true )

method (new in 2.5), or maintain a counter in the context for keeping track of the number of loops.. ie create a script after the request containing

Code:
if( context.counter == null )
   context.counter = (int) 5

if( context.counter > 0 )
{
    context.counter--
    testRunner.gotoStepByName( "getCasesBySubject - Request Transformation Failure -101" )
}

Here the script first checks for a counter and initializes it if missing, the counts down a loops back to the request for 5 times..

Hope this helps!

regards,

/Ole
eviware.com
Logged
KrishnaReddy YV
Newbie
*
Posts: 3


« Reply #2 on: October 15, 2008, 12:02:37 pm »

Hi Ole,
         Thanks for the prompt reply. As you suggested I have installed the Soap UI 2.5 version and executed code as below -

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.runTestStep( testRunner.testCase.testSteps["getCasesBySubject - Request Transformation Failure -101"], true, true )
   count ++;
}

But I got an exception as below mentioned -

groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.panels.support.MockTestRunner.runTestStep() is applicable for argument types: (com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep, java.lang.Boolean, java.lang.Boolean) values: {com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep@453dd5, true, true}

For you reference here I'm attaching the structure of the TestSuit.



what could be going wrong here..

thanks
krish
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,466


« Reply #3 on: October 15, 2008, 12:09:47 pm »

Hi Krish,

sorry, I was a bit fast in publishing this; you will need to get the latest nightly-build to have this method working correctly.. get it from http://www.eviware.com/nightly-builds/2008-10-15/pro/

regards!

/Ole
eviware.com
Logged
KrishnaReddy YV
Newbie
*
Posts: 3


« Reply #4 on: October 15, 2008, 02:02:19 pm »

Hey Ole,

I don't understand what is wrong here.
i installed your nightly build version and still getting the same error. attaching screen shot for your reference.



pl let me know what more info i can provide to debug this error.
thanks
Krish.

ps: we can get in touch over phone if its ok with you. Need to get this working ASAP. you can email your contact no to me on: manmaygupta[at]gmail.com
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,466


« Reply #5 on: October 15, 2008, 09:15:24 pm »

Hi!

please try using

testRunner.runTestStepByName( "getCasesBySubject - Request Transformation Failure -101"] )

instead, let me know!

/Ole
eviware.com
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header