How can I call data in multiple sheet from my excel file in one script
For example: my excel file has two sheets A and B, and I need to get data from them to put in my script. However, Katalon just loads data from one sheet at once ?
How can I call data in multiple sheet from my excel file in one script
For example: my excel file has two sheets A and B, and I need to get data from them to put in my script. However, Katalon just loads data from one sheet at once ?
Hi Nguyen,
Currently, a instance of TestData only loads one sheet that was specified in your Test Data.
To deal with your case, we can do this:
ExcelData myData = (ExcelData) ObjectRepository.findTestData(“your_test_data_id”)
def dataOfSheetA = myData .changeSheet(“sheet_A”).getAllData()
def dataOfSheetB = myData .changeSheet(“sheet_B”).getAllData()
To list all sheet names of a test data, please try:
myData.getSheetNames() (String)
Please remember that ExcelData is an implementation of TestData and only works for Excel file.
Hopefully, my sharing will help you.