The article Approach Data-driven framework in Software Testing - DZone described 2 ways.
- A. Execution From test Suites
- B. Execute From a Test Case
If you take the “A”, your test case will have the following line:
WebUI.setText(findTestObject('Page_Login/txt_UserName'), demo_usn)
On the other hand, if you take the “B”, your test case will have the following line:
WebUI.setText(findTestObject('Page_Login/txt_UserName'), data.internallyGetValue("demo_usn", index))
Do you understand the difference between these 2 lines?
data.internallyGetValue("demo_usn", index)
in the script “B” is replaced to a Groovy variable (demo_usr) in the script “A”. Behind the scene in “A”, Katalon Studio retrieves the data from external Excel sheet and inject it into the associated Test Case Variable; this automaton is what “Data Binding” means. This approach requires you to define variable names in Test Case’s “Variables” tab. @shivam1, you want to avoid this setting work, don’t you?
In “B”, you do not have to add Test Case Variables “demo_usr” and “demo_pwd”. The script of B refers to the data by String literals("demo_usr"
) not by a Groovy variable (demo_usr
). Therefore you can avoid the operation 1 if you follow the approach “B”.
However, in both of “A” and “B”, if you want to make your test refer to the newly added “demo_foo” data, you need to change your Test Case script anyway.
No, there isn’t.
If you add a new data column in your Excel sheet and leave your test cases unchanged, then simply the new data will be ignored and unused. If you want your test cases to refer to the new data, you have to change your test cases anyway; this applies to both of approach “A” and “B”.