Assume that I have a test suite where I have multiple test cases.
I would be running this test suite against my test server and against my Live server (for some deployment sanity etc) as well.
The test data are not going to be same in both of these servers.
The suite is exactly the same
At the moment the tool demand the test data to be tightly binded to the test suite, no much flexibility to change this during run time and user to pass any test data that he needs
any way to handle this, so that i can keep just one test suite which can be executed against multiple test data files with out editing it from GUI
I meant to supply the test data and it to reach at the test case level, we use data binding at the test suite rite.
so its like test suite is always linked to only one test data file. to make test suite to work with another data file, we need to come to GUI and make the necessary change.
this is the way we can make test data supply to test suite ( we can link test data at the test cases level too, but that will stop data driven concept etc)
so i was thinking, if i have a single test suite… how can i make it run for multiple test data file easily
Yes, In the UI we really can’t bind two different test data in one test suite. And we also can’t add the same test case. So I came up with the idea that it can be done programmatically through script mode of the test suite.
All we need is just add a dummy test case in the UI in order for the test suite to run but the real test is written inside of setUp method. . .
This is what I understand about your query, I hope my understanding is correct. . . you can try this:
@SetUp(skipped = false) // Please change skipped to be false to activate this method.
def setUp() {
// Test server
TestData testDataServer = findTestData("Data Files/TestDataServer")
WebUI.callTestCase(findTestCase("Test Cases/TC_Login"), [('userName') : testDataServer.getValue("Test_Username", 1),
('password') : testDataServer.getValue("Test_Password", 1)])
WebUI.callTestCase(findTestCase("Your_next_case"), [('nextCase_var1') : testDataServer.getValue("testColumn1", 1)],
('nextCase_var2') : testDataServer.getValue("testColumn2", 1))
// Live server
TestData liveDataServer = findTestData("Data Files/LiveDataServer")
WebUI.callTestCase(findTestCase("Test Cases/TC_Login"), [('userName') : liveDataServer.getValue("Live_Username", 1),
('password') : liveDataServer.getValue("Live_Password", 1)])
WebUI.callTestCase(findTestCase("Your_next_case"), [('nextCase_var1') : liveDataServer.getValue("liveColumn1", 1)],
('nextCase_var2') : liveDataServer.getValue("liveColumn2", 1))
// Put your code here.
}
One alternative way of data binding is available. Data binding at test case level. Use com.kms.katalon.core.testData.TestData class. See the following post:
In a test case, you can parameterize the name of TestData passed to TestDataFactory.findTestData(xxxxx).
but it will have its own problem, it will be difficult to achieve data driven concept here due to below issue.
as it is put in a for loop, assume there is a problem happens at the execution of first data, then it will stop the execution of entire data set. so ultimately your remaining test data are not getting executed