(older archive entries before 2007 are not shown here, but included in the onsite-search)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[QF-Test] Jython question regarding referencing a java object...
I'm getting a TypeError: method():2nd arg can't be coerced to pkg.MyClassName within a Server script node.
I instantiate a MyClassName object, newObject=StaticClass.createNewObject(), in a Server script and call an rc.setLocal("ReferencName",newObject). I've also tried setGlobal as well with the same result.
Later downstream from that node, in the same Test Case node, in another Server script, I call fetchObject=rc.lookup("ReferenceName"). In the same script, I use that reference in a function call, anotherObject= StaticClass.method(someString, fetchObject).
I've compiled the java code into a jar file and placed it in the plugin directory like I normally do. I imported the classes in the Server script like I normally do. I tried both a setLocal and setGlobal methods of the run context. I understand that when I do, there is a String association to the object, so that when I call rc.lookup(), fetchObject is a String, but I need the object so I can pass it into method. How do I do this?
Hope my example makes sense. I wanted to make it as generic as possible.