Adding groovy function to script file
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding groovy function to script file
Adding 2 function to script file under bin\script\
class myClass
{
def f1(val1, val2){ ....}
def f2(val1){ def status = true
return status
}
}
saving the file under bin\script\myscript.groovy, then adding groovy test step.
"
def s1= "s1"
def s2 = "s2"
util = new Myclass()
util.f1(s1,s2) >>... This works fine
...
while in another script
def s1= "s1"
util = new Myclass()
def returnVal = util.f2(s1) ... This call fails with error missing the signature
It is as, if the update to the script file is never loaded to Ready API, I have restarted ready api but that did NOT help.
Solved! Go to Solution.
- Labels:
-
Automation Environments
-
Scripting
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry I meant, restart Ready API did NOT help.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just see if this is a reason.
It is defined class as "class myClass"
However, it is used "def util = new MyClass()" which is incorrect usage.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem was, when I updated Ready API from 3.9.0 to 3.9.1 the project still pointed to the bin\script under 3.9.0,
So problem solved, thanks for the help ;o)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
