Forum Discussion

Unibet_Support's avatar
Unibet_Support
Contributor
12 years ago

External values should transfer before Project LoadScript

Currently, any property values set from outside when running tests from Maven (or any other tool i guess), are not set (transferred to SoapUI) before the Project LoadScript is executed.
They are transferred AFTER, when the TestCaseRunner is initiated (se LOG output below)
To me, it would seem natural that any info coming from the "outside", would be transferred to the "inside" before anything else happens, since you cannot possibly know when the info is going to used (and what for).
Right now the "Project LoadScript" is performed first and then, when the testrunner kicks in, the properties from the POM-file are transferred to the Project properties.
Example:

Maven POM-file:
<projectProperties>
<value>ENVIRONMENT=${integration.test.environment}</value>
</projectProperties>

Command line:
mvn -Dintegration.test.environment=si1 test

Project LoadScript:
def env = context.expand( '${#Project#ENVIRONMENT}' ); (is already saved as "qa1" in the project, and is supposed to be overridden by the external parameter)

LOG output:
2012-09-25 15:29:35,048 INFO [log] ###### PROJECT LOAD: Casino2 ######
2012-09-25 15:29:35,747 INFO [log] Server1: https://www.somehost1.com
2012-09-25 15:29:35,747 INFO [log] Server2: https://www.somehost2.com
2012-09-25 15:29:35,748 INFO [log] ##############################
2012-09-25 15:29:35,755 INFO [SoapUIProTestCaseRunner] Setting project property [ENVIRONMENT] to [si1]

The three first lines in the LOG shows the output from the "Project LoadScript", which is performed BEFORE the property transfer from Maven (or any other tool).
The value for "Server1" & "Server2" above is set through a lookup which uses the Project property "ENVIRONMENT" (which should have been overridden, but has not and therefore contains the value which was saved with the project).

The LOG also shows that the transfer of external values is performed by the "TestCaseRunner", instead of the "Project startup".

Best regards,
Tommy Pettersson, North Development (Unibet), PI-Test

1 Reply

  • Oooops, sorry.

    I discovered that what I'm trying to do is available through "Setup Script" for Test Suites (which is under the second TAB in the "Project" window.
    Not the most evident "place" to find, but very logical once you are aware of it's existence

    /Tommy