soapuifan
13 years agoOccasional Contributor
what is the issue with object accessability
HI,
I did small library for suapui,
and I am using that in my tests...
But I can not understand the issue with object accessability in script functions...
Can you answer, pls
Ok let me articulate a question:
why my object (xxx) is not visible in the functions, and the (tc) object is visible?
my script (test step = script) in given soapui testcase looks like this:
=========================================================
import my.lib.blabla.* //here is MyLibClass
def tc=TestRunner.TestCase
def xxx = new MyLibClass(1)
def out = my_function(1,2)
log.info out
return
def my_function(a,b) {
def str1 = xxx.method1(a)
def str2 = xxx.method2(b)
def str3 = tc.getClass().getName()
return str3 + " : " + str2 + " : " + str1
}
===================================
as you can see I am trying to access xxx object in my_function(a,b)
why I receive error here:
:ERROR:An error occured [No such property: xxx for class: Script21], see error log for details
I did small library for suapui,
and I am using that in my tests...
But I can not understand the issue with object accessability in script functions...
Can you answer, pls
Ok let me articulate a question:
why my object (xxx) is not visible in the functions, and the (tc) object is visible?
my script (test step = script) in given soapui testcase looks like this:
=========================================================
import my.lib.blabla.* //here is MyLibClass
def tc=TestRunner.TestCase
def xxx = new MyLibClass(1)
def out = my_function(1,2)
log.info out
return
def my_function(a,b) {
def str1 = xxx.method1(a)
def str2 = xxx.method2(b)
def str3 = tc.getClass().getName()
return str3 + " : " + str2 + " : " + str1
}
===================================
as you can see I am trying to access xxx object in my_function(a,b)
why I receive error here:
:ERROR:An error occured [No such property: xxx for class: Script21], see error log for details