Forum Discussion

pradeep84's avatar
pradeep84
Occasional Visitor
9 years ago

I want to use an common excel for data input for all my test cases under one test suite.

I want to use an common excel for data input for all my test cases under one test suite.  I can see datasource can be defined as one test step and it can only be used in that test case. 

2 Replies

  • rupert_anderson's avatar
    rupert_anderson
    Valued Contributor

    Hi,

     

    If you mean the pro datasource test step then, yes, in my experience it forms part of a TestCase only. Although in the the case of load testing it is effectively shared between multiple (threaded) TestCase instances.

     

    Here are some ways I have provided a more global e.g. TestSuite level datasource:

     

    1. Custom Groovy Datasource (accessed from a TestSuite level) - Unless your TestCases run in sequence i.e. not simultaneously,  then the main trick here is providing a thread-safe means for each running TestCase to get the next test data row/item of data. If you want to do this I can provide more details.
    2. Service based datasource - This approach involves delegating providing the next row/item to a web service that is called from multiple TestCases (using a suitable TestStep) to provide the next test data row/item. Note thread-safety can still be an issue inside the service. You could also use a mock as the service. One advantage of this approach is that it can be shared across multiple instances of SoapUI e.g. using separate test runner scripts, perhaps to provide additional load. Again let me know if you need more advice with this approach. 

    Both approaches are quite doable a work well. The second approach is probably slightly more work.

     

    Hope this helps,

    Cheers,

    Rupert