hello
i already created some tests which use a datasource and also pass it along to "sub-tests", meaning to tests which are executed as a step inside a test. to make my tests modular and use the same test with different data i would like to create a test structure as follows:
i have one big test case which consists of some usual teststeps, custom coded steps and sub-tests.
for example the overall Testcase "mastertest" starts with a subtest "Login" which simply performs a login with given credentials.
the login data is passed from the mastertest to the subtest.
after login i do some some navigation and then call a subtest called "createCategory".
the "createCategory" performs some actions and uses also data from an excel file but i would like to specific which excel file to use for this specific call. the data for createCategory consists of multiple columns and 3 rows to excecute it 3 times with different data. this behavior will be used again in createCategory to call another subtest and so on.
for my automatic tests to run i would prepare 3 excel files for the mastertest to cover 3 different use cases. i start the mastertest once which each excel file. depending on the data provided in the excel file different data is passed to the subtests.
Can i set the datasource for each test dynamically? if so could you provide me with a short example?
If this specific approach is currently not possible is there any other way to create modular test with various datasources?
the other option would be to create one test with one datasource, copy this test and exchange the datasource but this would be hard to maintain if tests need to be adapted/extended.
Regards
i already created some tests which use a datasource and also pass it along to "sub-tests", meaning to tests which are executed as a step inside a test. to make my tests modular and use the same test with different data i would like to create a test structure as follows:
i have one big test case which consists of some usual teststeps, custom coded steps and sub-tests.
for example the overall Testcase "mastertest" starts with a subtest "Login" which simply performs a login with given credentials.
the login data is passed from the mastertest to the subtest.
after login i do some some navigation and then call a subtest called "createCategory".
the "createCategory" performs some actions and uses also data from an excel file but i would like to specific which excel file to use for this specific call. the data for createCategory consists of multiple columns and 3 rows to excecute it 3 times with different data. this behavior will be used again in createCategory to call another subtest and so on.
for my automatic tests to run i would prepare 3 excel files for the mastertest to cover 3 different use cases. i start the mastertest once which each excel file. depending on the data provided in the excel file different data is passed to the subtests.
Can i set the datasource for each test dynamically? if so could you provide me with a short example?
If this specific approach is currently not possible is there any other way to create modular test with various datasources?
the other option would be to create one test with one datasource, copy this test and exchange the datasource but this would be hard to maintain if tests need to be adapted/extended.
Regards