Forum Discussion

SoapUser2012's avatar
SoapUser2012
Occasional Contributor
14 years ago

Data driven test suite execution

Hi ,

I have different sets of data .Want to data drive all the test cases in a test suite for all the sets of data.

Ex say ,I have different property files . Need to run the test suite for each of the property file .
Or say, i have external data sheet with many sets of data. Need to run the test suite for each row of data.

Pls suggest .

thanks

5 Replies

  • SoapUser2012's avatar
    SoapUser2012
    Occasional Contributor
    Well, i had gone thro this data driven execution in the soap ui User guide.

    I wanted to do know if we can run that in a script .

    For example,i have a groovy script which takes the testcases in a test suite and runs them in a loop .
    Is there a way to data drive them? meaning each test case should run for sets of data . Just checking ,is there a option like that .

    Is the question clear now? pls advice .

    Thanks
  • Hi,

    for this specific scenario I would advise using a "Run TestCase" teststep inside a DataSource setup - you would be calling the target TestCase for each row in the DataSource and can use the property-passing mechanism of the Run TestCase TestStep to pass in unique data for each run.

    regards,

    /Ole
    SmartBear Software
  • SoapUser2012's avatar
    SoapUser2012
    Occasional Contributor
    Could you pls elaborate it how i achieve this ? I could add a 'Run Testcase" step . Do we need to point the run testcase step to the test request (test case in same testsuite)

    thanks you,
  • Hi,

    yes:

    1) point the Run TestCase TestStep at the TestCase that you want to run for each row in your DataSource
    2) define TestCase properties in that TestCase for each data value you want to pass from the DataSource
    3) in the TestCase set up property-transfers or property-expansions to use those properties accordingly
    4) in the calling TestCase (containing the Run TestCase TestStep) set up property-transfers from the DataSource to the TestCase properties exposed by the Run TestCase TestStep

    -> For each iteration the TestCase property values of the target TestCase will be set from the DataSource (via 4) and used in that TestCase when it runs (via 3)

    Hope this helps!

    /Ole
    SmartBear Software