assert / verify URL

Hello,
is there any option to do assert/verify on a URL ?
let say i clicking on object and want to verify i directed to a URL or even stayed on the same URL - how can i set it on Katalon ?

2 Likes

Hello,
is there any option to do assert/verify on a URL ?
let say i clicking on object and want to verify i directed to a URL or even stayed on the same URL - how can i set it on Katalon ?

Hi there,

You can do it easily in Katalon Studio. We have a keyword called ‘Get Window Title’ and you can use it for assertion, e.g:
assert WebUI.getWindowTitle() == ‘My Title’

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

2 Likes

How to Assert username and password in Mobile?

Sivasankaramalan Gunasekarasivam said:

How to Assert username and password in Mobile?

Mobile is different. However you can use ‘Get Element Text’ in this case to get text of current element and compare it. So it should be:
assert Mobile.getElementText(findTestObject(‘your/object’)) == yourValue

If you want to ensure a link/test object opens to your intended URL, you can use getURL and VerifyMatch. Just remember if your link/testobject opens to a new tab to add switchTowindow before hand. Ex: CurrentURL is the URL variable to match to your intended URL “google.com

WebUI.click(findTestObject(‘xxLINKxx’))
CurrentUrL= WebUI.getUrl()

WebUI.verifyMatch(CurrentURL, ‘https://www.google.com’, false)

3 Likes

why i can’t find getElementText in the autocomplete ?

This still throws the MissingMethodException even though it also shows that the strings match:

test
WebUI.VerifyMatch(WebUI.getUrl(), GlobalVariable.baseUrl, false)

response
VerifyMatch() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.Boolean)
values: [http://localhost:8080/, http://localhost:8080/, false]

Is there any way to do soft assert? so whats the difference between checkpoint and assert?