Check URL for string

Hey there,

I am new to Katalon Studio and I try to check an URL for a special string. I refer to https://docs.katalon.com/katalon-studio/docs/ws-contains-string.html and tried the following:

def url = WebUI.getUrl()
println(url)
WS.containsString(url, ‘modelsandgroups’)

println shows me the correct URL, but the next step throws the following exception:

Test Cases/webURL FAILED.
Reason:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords.containsString() is applicable for argument types: (java.lang.String, java.lang.String) values: [https://xxx.yyy.zzz/aaa?v=2&ids=&sort=popularity&takeoverContract=0&newContract=1&newCar=-1&manufacturer=97&modelsandgroups[]=0&monthlyLeasePaymentsFrom=&monthlyLeasePaymentsTo=&durationFrom=&durationTo=&colorId=0&searchFueltypeId=0&gear=&enginePsFrom=&enginePsTo=&registrationYearFrom=&registrationYearTo=&mileageFrom=&mileageTo=&zipcode=&adId=&t=1100000, …]
Possible solutions: containsString(com.kms.katalon.core.testobject.ResponseObject, java.lang.String, boolean), containsString(com.kms.katalon.core.testobject.ResponseObject, java.lang.String, boolean, com.kms.katalon.core.model.FailureHandling)
at webURL.run(webURL:58)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1583311419902.run(TempTestCase1583311419902.groovy:23)

What do I oversee?

Hello there,

I managed it by using an if-statement and by url.contains(). Thread will be closed now.