Forum Discussion

LennSar's avatar
LennSar
Contributor
2 years ago

Test Suite global DataSource

Hi there,

 

I have a Test Suite with a bunch of different Test Cases that all have to use data from a csv file. Furthmore this Test Suite can be applied to various devices by just changing the csv file. My question now is: What is the best way to have a single spot where I can change the file path so that I can run the test suite with all it's test cases for various devices with individual csv files? 

The only way I could come up with is to make a "generic" test case as the first test case in the suite and add the DataSource here. All other test cases than access the data source from the "generic" test case. It seems to work fine but feels more like a workaround than best practice. 

 

Any other suggestions would be highly appreciated.

 

Thanks,

 

Lennart

1 Reply

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

     

    I'd probably create a Custom Property at the test suite level.  E.g. csvFilename with a value of the file of interest.  Then, in each datasource step within the test cases of that suite, you could reference that custom property.

     

    This should mean you only have to change the file and path in one place.

     

    If you haven't used Custom Properties, have a look at @lucien tech note.  Link