Hi!
I have an issue on how to use custom classes methods that I’ve written in Keyword methods when using tests.
Now the situation is as follows
I have 2 different packages, one for custom classes with keywords and one for helper classes and methods that I’d like to use withing said keywords.
For example, I have a class with keywords for handling login in my application:
def performLogin(){
WebUI.navigateToUrl(buildURL())
WebUI.setText(findTestObject(‘Login/input_user’), GlobalVariable.application_usr)
WebUI.setText(findTestObject(‘Login/input_passw’), GlobalVariable.application_passw)
WebUI.click(findTestObject(‘Login/btn_signIn’))
}
Since the application URL doesn’t work in the String format from the global variable (due to ports and such), I have to build the URL every time I want to use it. Since I don’t want to duplicate code, I also have a second package that builds the URL.
//Builds the URL from the global variable address
def buildURL(){
URI uri = new URI(“https”, null, GlobalVariable.application_url, 8080, null, null, null)
URL url = uri.toURL()
return url
}
However, no matter what I try to import or how I notate the call, I can’t see to get this working. When I run the test (and the execution goes Test → Keyword → buildURL), I always get the following error:
FAILED because (of) org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method
Can somebody help me with this?