Hello
I have an API , I need to check multiple url ,
How can I add list of url in test case and test suit
Individually it is working fine
2 Likes
1.create a excel file and add all the URL’s you have in row-wise
2.create a test case with a loop to and fetch the values from the excel file in a row-wise and and assign it to a variable
3. assign the variable as a URL to the API test script
if you need to get the results for each URL’s please write the same in to the same excel file.
Example
int j= findTestData('API URL List').getRowNumbers()
for(int i=1;i<=j;i++)
{
String uRL= ExcelKeywords.getCellValueByIndex(sheet1, row, column)
-----your API Script here-----
assign uRL to the script
if needed add the setCellvalue script to add the result into a new or existing workbook
}
1 Like
You can read external file for URL etc.
1 Like
Dear Kazuryam, I happy to see you reply ,
But How can I use this in API testing
Like I have 3 url for login api
How can I add all them in test case or test suit ?’
Individually its working fine
1 Like
- declare a list
- add the URL’s to the list
- iterate the result
- fetch the URLs assign it to the API Scripts
execute the test script or you can add the script into a suite and execute it