Ask a Question

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

SOLVED
hafizimraan
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  

 

13 REPLIES 13
nmrao
Community Hero

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.
HimanshuTayal
Community Hero

@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
hafizimraan
Occasional Contributor

@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();

 

@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

@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.
nmrao
Community Hero

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.

@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

That is in the hands of author of the question.


Regards,
Rao.

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
cancel
Showing results for 
Search instead for 
Did you mean: