问题
Can I know how to read data from excel sheet in Katalon Studio, so as to read API endpoint from file to check its output?
How to code in java to make the URL run and verify the response from the API endpoint?
回答1:
I’ve created a sample project using Katalon Studio, you can use it to map with your scenario:
- HTTP endpoint is defined as 'REST_CommentDetails' test object
- Other rest parameters are defined as Excel file in 'REST_Parameters' test data
- Test Suite:"TS_RegressionTest" will do as you require: "I should be able to read the contents from excel sheet and run the endpoints one after the other with the given set of the input in Katalon Studio and then print out result directly on console view" if you execute the test suite directly.
回答2:
to read data from excel sheet.
- right click on data files> add new > test data - give the name - select Data Type as "Excel File"
- Browse the file and select Sheet Name. (you can check 'use relative path'.{it is the best practice}
- Go to your test case. Double click on input row (where you want to add data from excel sheet)
- Click on 'Value Type' and select 'Test Data Value'
- Double click on "value" and select Test Data, column, row.
来源:https://stackoverflow.com/questions/44904760/how-to-read-data-from-excel-sheet-in-katalon-studio