No guarantees, but you might try saving the object in testExec and recalling it when you need it.....
NOTE: I don't know what your objects are doing nor what they might be composed of so I cannot comment on the potential memory hit.
For example - on first use, save it off:
import com.my.object.myConnObject;
myConnObject mo = new myConnObject();
myConnObject.setSomething("something");
//other work
testExec.setStateObject( "prop_myConnObject", mo );
return;
Later when another step needs to use it...
import com.my.object.myConnObject;
myConnObject mo = (myConnObject)testExec.getStateObject( "prop_myConnObject" );
if ( mo == null ) {
// print in ITR Events, Workstation.log or one of the server logs
// where this step is running (i.e., vse.log, simulator.log, etc.)
_logger.info( " <<<< Uh Oh! My Connection object is not available, something is wrong!" );
// property does not exist, so instantiate it or take appropriate error action
}
// other work, then on the way out to keep it fresh
testExec.setStateObject( "prop_myConnObject", mo );
return;
There may be other techniques if you are using Groovy.