Forum Discussion

kowcik's avatar
kowcik
Occasional Contributor
7 years ago

DataSource Excel value fetch issue while executing in parallel

Hello

 

I have 100 test cases in test suite and we are using datasource - excel to fetch values for our services. Randomly 10 cases are getting failed in parallel mode execution. We found it is due to values are not fetching from excel sheet..

 

We are using 1 worsheet with multiple sheets

 

 

Thanks in advance

 

 

1 Reply

  • StevenColon's avatar
    StevenColon
    SmartBear Alumni (Retired)

    Thank you for posting to our Community Forum.

     

    It seems like each TestCase has its own DataSource that accesses the same excel file.

     

    In ReadyAPI, file access is implemented in such a way that it needs exclusive access to it to read/write.

     

    When running TestCases in parallel (all accessing 1 excel file), the chance of two or more DataSinks attempting to access the file at the same moment increases with the number of TestCases. This is unavoidable.

     

    There are a couple ways you can resolve this:

    1. Put data into separate files to limit the amount of TestCases attempting to access the same file.
    2. Use a TestCase (to run before running all the other tests) to read the excel information (DataSink) and input it into TestSuite level custom properties (Property Transfer). Now you can have the TestCases access the property values and don't have to worry about file access.

    These are the two things I can think of. Each option has it's pros/cons so you'd have to consider them in regards to the specifics of your project and environment(s).

     

    Let me know if you have any questions/concerns.