Connecting Katalon Studio into XLS and CSV files
Since reading from external source files has become an important part of how we get data, I wanted to put together some simple examples to show reading data from a CSV file, an XLS file and from a Database source. All three are very similar and since Katalon handles most of the work, it's easy to grab data from a file with just a few lines of code. We start by using the TestData library and reference the "Test Data File" from the "Data Files" object in the project. That is done with: TestData csvData = findTestData("Data Files/Data Source Name") Once we have that, we can use some of the built in Katalon keywords to get the number of rows in the file and the column names. int rowCount=csvData.getRowNumbers() List columnNamesList=csvData.getColumnNames() Once we have that information we know how many rows we can read and how many columns. We then use getValue to read our piece of information. temp1=csvData.getValue(columnName, rowNumber) […]
Recent Comments