klusht
13 years agoOccasional Contributor
Script library plus function class
Hi all ,
I need to make my scripts world wide available , and I need to find a nice way to make the scripts available for anyone in a less effort approach, and also be flexible enough.
I created a jar file with a class full of static functions, and after I deploy it in ext folder, I can use those like valx = new functions.F(log).time() ( package functions , class F with constructor F(log4j.Logger log) to be used in the class , and method time() ).
But it is ugly, and I need to initialize this class ( functions.F(log) ) under a nicer shorter name, like context.setProperty("f", new functions.F(log)) ( then to be used as context.f.time()).
So I nee a place where to put this initialization step, and where soapUI executes this line at sturt-up , or before lunching each the testRunner.
I've try ed to put in the project "custom property" something like :addFunctions = ${=context.setProperty("f", new functions.F(log))} but is not executed by default, so is available only if I run this statement inside the testStep.
Can you suggest me a second place where I can put statements that are run before each test step...
Also , is there a way to put a script precondition IN the testStep. like an "pre assertion"
I need to make my scripts world wide available , and I need to find a nice way to make the scripts available for anyone in a less effort approach, and also be flexible enough.
I created a jar file with a class full of static functions, and after I deploy it in ext folder, I can use those like valx = new functions.F(log).time() ( package functions , class F with constructor F(log4j.Logger log) to be used in the class , and method time() ).
But it is ugly, and I need to initialize this class ( functions.F(log) ) under a nicer shorter name, like context.setProperty("f", new functions.F(log)) ( then to be used as context.f.time()).
So I nee a place where to put this initialization step, and where soapUI executes this line at sturt-up , or before lunching each the testRunner.
I've try ed to put in the project "custom property" something like :addFunctions = ${=context.setProperty("f", new functions.F(log))} but is not executed by default, so is available only if I run this statement inside the testStep.
Can you suggest me a second place where I can put statements that are run before each test step...
Also , is there a way to put a script precondition IN the testStep. like an "pre assertion"