How to create methods and define custom keywords in Katalon Studio

I would like to know that how can I create methods like selenium with Java and define custom keywords. I have tried to define custom keyword but somehow not successful. Below is the error description and link to error image:

Error Description:

groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findTestObject() is applicable for argument types: (java.lang.String, java.lang.String) values: [Katalon Demo Project_OR/Page_CURA Appointment/Page_CURA Healthcare Service-Login/input_username, …]
Possible solutions: findTestObject(java.lang.String), findTestObject(java.lang.String, java.util.Map)

 

C:\Users\b.rani\Desktop\Screenshots\Katalon_Studio_ Custom Keyword Error.png

Hi Bhawna,

The function ObjectRepository.findTestObject() only accept 1 parameter with the type String. You’re passing 2 strings, that’s why your keyword failed.

the error which i was facing

Test Cases/Test Case01 FAILED because (of) org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: com.ocr.readtext.main() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject) values: [TestObject - ‘Object Repository/Page_perseverance - Google Search/div_perseverancepsvr()nsnounno’]

Possible solutions: wait(), wait(long), any(), find(), wait(long, int), reading(com.kms.katalon.core.testobject.TestObject)

Please help

Please help me to provide your custom keyword definition and also your parameters. That error message indicates that you pass in wrong parameter’s type which is currently not supported from the custom keyword.