How can I get the status code of some urls dynamically?

Hello,

I have created an excel file with some urls and I want verify the status code.
I have created a variable inside the test case that retrieves each urls from the excel. How can I get the status code of every urls dynamically (I want to check them to be 200)?

ExcelData data = findTestData('Data Files/Code and Theory/Global menu/url excel')
int rows = data.getRowNumbers()
for (i in 1..rows){
String url = data.getValue(2, i)
WebUI.navigateToUrl(url)

Thanks

You can use Katalon built-in keywords for Web Service mixed with keywords for Web UI testing.

Have a look at WS.verifyResposeStatusCode() :
https://docs.katalon.com/katalon-studio/docs/ws-verify-response-status-code.html

This should be exactly what you want.