cancel
Showing results for 
Search instead for 
Did you mean: 

parallel execution issues when framework has dependency of library testcases on other testsuite

Regular Contributor

parallel execution issues when framework has dependency of library testcases on other testsuite

Let me clear my Q.. 

Framework designed like 

Project 

   Libtestsuite

       LibTestcase1

       LibTestcase2

   Testcasessuite

       Testcase1

       Testcase2 

 

-> Executing Testsuite using commandline 

-> When Running testsuite using command line under setup script i placed this below script to run testsuite PARALLEL

    which testcasessuite is executing parallel 

    import com.eviware.soapui.model.testsuite.TestSuite.TestSuiteRunType
    testSuite.setRunType(TestSuiteRunType.PARALLEL )
 

    But issue is when testcasesuite executing parallel 

        Testcase1 has dependecy of libtestcase1

         Testcase2 has also dependecy of libtestcase1 

 

So, both Testcase1 and Testcase2 take same data from libtestcase1 and failing the testcases 

 

I hope i made it clear... can any one help here 

 

11 REPLIES 11
Community Hero

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

@678,

Thumb rule is each and every test case has to be independent.

The information available is not sufficient to comment why test cases are failing. You haven't mentioned either what is causing to failure.
Also, not sure what sort of data that are being supplied to other test cases.

Is possible to create a sample project to replicate the issue?
Does the sequential execution work fine?
Reason for executing them in Parallel?


Regards,
Rao.
Regular Contributor

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

@nmrao 

 

Thanks for replying 

 

1) Yes Sequential order working as expecting 

2) Reason of Parallel - to decrease the execution time as testsuite going bigger and wanted to reduce time of execution 

3) from Libtestcase1 is kind of accountgeneration like account1 and testcase1 and testcase2 both using same account1 the intention is when i running sequential testcase1 - getting data from libtestcase as (account1) and 

testcase2 - getting like (account2) 

 

but where as on parallel run both testcase1 and testcase2 getting the data as account1 and testcases are failing as duplicate data 

 

i hope this helps 

 

Community Leader

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

I'm making the assumption that your test cases in the "Testcasessuite" test suite are calling the test cases in the suite "Libtestsuite" via the Run TestCase Test Step, if this is correct? If so have you checked to see what the Run Mode is?

 

Check to see if the run mode is set to "Create isolated copy for each run", as from the documentation:

 

"ReadyAPI creates a copy of the target test case in the memory and runs it. This way, the run will not affect other concurrent runs of the test case. With this mode, several copies of the target test case can run in parallel."

Regular Contributor

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

@Radford 

 

Yes exactly same process i am following... 

 

and i was using Runtestcase with - create isolate copy of each run... but still its taking account1 as a test data for both the testcases on testcasesuite 

Occasional Contributor

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

I have a set up similar to OP and I've run into similar issues except in my case, all of the LibTestSuite are just scripts calling other Test Suite Test Cases. The flow is like the following

 

TestSuite A runs TestCase A

TestCase A uses a Script to call a script in LibTestSuite

Scipt in LibTestSuite calls another TestSuite to make calls for uploading a file

 

If multiple test cases in TestSuite A are doing the same, it'll run into errors if run in parallel

 

I think because we're calling the other test suites using the scripts, it causes some wierd dependency and the files can't be uploaded. We may need to try using the 'Call Test Case' instead and see if that helps but I'm not sure given how we set it up. 

 

I know this doesn't help your issue, but it's very similar and I'm curious of how to best handle that. 

 

Community Hero

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

@678,

Thank you for that.

What are the test steps (including step types) Libtestcase1? Post the content of the script if it include any groovy step.
Also Libtestcase2?

When you say Library test case, is it something a default functionality of ReadyAPI or is it custom defined one and you calling it library?



Regards,
Rao.
Regular Contributor

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

@nmrao 

LibTestSuite 

      Testcase 1 -  JSON Request to generate (Generate Account Number) TestData - No Groovy Scripts 

      Testcase 2 -  JSON Request to generate (Generate User Name)  TestData - No Groovy Scripts

     

Community Hero

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

If there is only one step, then you can include that in the actual test case. Can that be not done to avoid issues?


Regards,
Rao.
Highlighted
Regular Contributor

Re: parallel execution issues when framework has dependency of library testcases on other testsuite

its not only one step there is multiple JSON requests as steps  to generate account # or user names 

New Here?
Join us and watch the welcome video:
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win