cancel
Showing results for 
Search instead for 
Did you mean: 

How to run next test step/case while previous one is still running in SoapUI Pro?

SOLVED
Highlighted
Occasional Contributor

How to run next test step/case while previous one is still running in SoapUI Pro?

Hi Community Members

Under one test suite I have multiple test cases i.e.1 to 10. Upon running of test suite Soapui does have option to run in parallel/serial but my scenario requires to run test suite in serial mode and then the real problems comes that it is required in my scenario to run test case 3 while test case 2 is still in running state. But so far am unable get the solution because in test suite while running in serial its waits to complete the execution of step 2 then moves to step 3. So is there any way that I just trigger the test case 2 using script etc & test suite proceeds to next step instead of waiting of response (Step 2).

 

Let me know if you guys have any ambiguity regarding above problem statement.

Regards  

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

Got the solution by adding following code under groovy step.

Thread.start {
	testRunner.runTestStepByName("Test Step 1")
}
testRunner.runTestStepByName("Test Step 2")

What does this code do: 
Thread.start will run Test Step 1 & will move to Test Step 2 without waiting for the result/response of Test Step 1.
@nmrao @HimanshuTayal  Thanks Guys for your help. Really appreciated.

 

View solution in original post

13 REPLIES 13
Highlighted
Community Hero

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

Not sure why tests are designed like that. It is important that each test case is independent.
1. What is your use case or functionality that you are trying to achieve?
2. Would it be possible to update the tests so that no dependency between the tests?

 

YOu may use Run Test case step instead if you still need to re-use existing test case. Refer documentation

https://support.smartbear.com/readyapi/docs/soapui/steps/run-test-case.html



Regards,
Rao.
Highlighted
Community Leader

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

@hafizimraan : As @nmrao  is saying, every TestCase should be independant but if there is any dependancy in which you want to execute some other Test Case then:

 

1. Create Test Suite name Reusable step,

2. Then place all the dependent Test Step in that Test Suite,

3. Then write groovy Script to Run that particular Test Step instead of calling it from another Test Case, place all the dependent Test Steps in seperate place.

 

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Occasional Contributor

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

@HimanshuTayal 

Got your point and already tried similar approach to achieve this but the porblem is with groovy that i used "testRunner.runTestStepByName(ABC)" but this function requires Test Step Result upon execution then move to next line of script. 
Would be better if you can provide any piece of script that will just trigger test case & move to next line of script instead of wait for test step result. This will resolve my problem. 


Even i tried Thread call using groovy but it doesn't trigger the test step. 
Here is the thread script i tried.

 

new java.lang.Thread(new Runnable() {
void run(){
println ("Start")
log.info "Starting Thread";
testcaserun = testRunner.runTestStepByNamepByName("Request1"); 
}
}).start();

 

Highlighted
Community Leader

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

@hafizimraan : Where are you writing this code in groovy script or in events of Soapui pro?

and could you please share any screenshot of the error.

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Community Hero

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

@hafizimraan 

Ok,

 

May be give it a try as below:

Assingming that step 1 and step2 are required to be run in parallel and they exists in the same test case. Disable these two steps becuase step3 will run them

step3 - groovy script test step with below script (change step names accordingly). Add this step.

 

//Modify step names as needed
def threads = ['Step1', 'Step2'] .collect { Thread.start testRunner.runTestStepByNamepByName(it)  }
// And wait for them all to finish
threads*.join()

 

 



Regards,
Rao.
Highlighted
Community Hero

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

Instead of steps, if testcases have to run the approach can be used. Of course, update run of testcase instead step in the above.


Regards,
Rao.
Highlighted
Community Leader

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

@nmrao  : Yes running TestCase will work instead of TestStep, that's the same thing i have suggested and also i am doing in some of my present Test Suites.

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Community Hero

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

That is in the hands of author of the question.


Regards,
Rao.
Highlighted
Community Leader

Re: How to run next test step/case while previous one is still running in SoapUI Pro?

Yes you are right we can only suggest.

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
New Here?
Join us and watch the welcome video:
Announcements