Forum Discussion

sburkard's avatar
Occasional Contributor
9 years ago

How to use shared testcases in another project for parallel execution?



I have several test-projects whose testcases need common "preparation" testcases. I would obviously like to create these preparation cases once and share them for all projects. Therefore I created a dedicated project and in this project I created a "TestHelper" testsuite containing such preparation test cases. 


From my normal test projects I am able to get the helper project and execute a testcase through a Groovy script. To reuse the caller script inside a project and to make the normal projects convenient to use, I created an additional testsuite inside the normal projects that is like an adapter to the shared helper-project. It contains testcases with just 1 teststep, the Groovy Script to call the real helper testcase in the helper project. 


From the normal testcase I can therefore use the standard and GUI supported "run TestCase" teststep to call the testcase in the adapter-testsuite (same project). This all works absolutely fine as long as I execute tests synchronously.


To sum up:

1. [Normal TestCase in any testsuite in normal Project] contains run TestCase teststep 

=> calls =>

2. [Adapter-Testcase in adapter-testsuite in normal Project] that contains GroovyScript

=> calls =>

3. [HelperTestcase in Helper project]


The problem: 

As soon as I run them in parallel, the tests fail because they receive values from the helper project that are not correct. It looks like the calls to the helper project are not isolated per testcase. 


The big question is: 

How can I use a shared helper project while being able to run the tests in parallel? 


A more concrete question is: 

I configure the run TestCase steps in the normal testcases as "Crate isolated copy... (Thread-safe)". What does that really mean? I guess that soapUI creates a copy of the testcase I call. So in my case the adapter testcase containing the Groovy script. Therefore I guess the context variable in the script is safe to use because each call runs in an isolated copy. How can I then make the call to the helper project thread-safe?








No RepliesBe the first to reply