How can I pass xpath as parameter in my custom Keyword method

read

#1

How can I pass xpath as parameter in my custom Keyword method.

Details:

I have created a custom Keyword and calling it in my Test case.
I want to pass TestObjects and Data file as Parameters to that custom keyword from Test case. But it is failing for me.

I am facing below error, any leads would be helpful:

org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: testMethods.MemberSearch.employerSearchInputFormResultList() is applicable for argument types: (org.openqa.selenium.remote.RemoteWebElement, com.kms.katalon.core.testdata.DBData) values: [[[CChromeDriver: chrome on XP (f14497893cb1c4ac1289eb27eacff951)] -> xpath: //form[@id=‘employerSearchform’]//table], …]
Possible solutions: employerSearchInputFormResultList(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.testdata.TestData)


#2

Can we see your code? Seeing the method and the full error would helps us try to help you with a solution.


#3

Hi @nehaverma2301

From the exception it is highly possible that your method employerSearchInputFormResultList does not accept arguments of types RemoteWebElement and DBData. You should check the method’s signature and pass in the appropriate data types.

Cheers !