SKoneru
12 years agoContributor
Environment switch doesn't work
Hi,
I did respond to this issue in my original post and noticed that I did not get any response(guessing may be because the Subject for that forum request is set as [Resolved]).
So created this new post. But please refer to my issue in this forum.
viewtopic.php?f=2&t=21716
The suggestion I got is to rely on "environment" option in settings.
I did try providing <environment> option and it didn't work. The value that I provided does not override with what is saved with the project.
In maven pom.xml file, I defined the environment in configuration section as follows-
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-pro-plugin</artifactId>
<version>4.5.1</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>Trading-soapui-project.xml</projectFile>
<junitReport>true</junitReport>
<exportAll>true</exportAll>
<outputFolder>${outputdir}</outputFolder>
<settingsFile>../Common/soapui-settings.xml</settingsFile>
<environment>QA</environment>
</configuration>
</execution>
</executions>
In the test case there is a Groovy test step that just prints the environment. Below is the simple Groovy script:-
def env = testRunner.testCase.testSuite.project.getActiveEnvironment().getName()
log.info "environment= ${env}"
This always prints the environment value with what is saved in the project. The value that we provided does not override. I saved the project with environment as "Production", so the
value displays as "Production" rather than "QA".
Can you please validate if this functionality is working.
Thanks in advance.
I did respond to this issue in my original post and noticed that I did not get any response(guessing may be because the Subject for that forum request is set as [Resolved]).
So created this new post. But please refer to my issue in this forum.
viewtopic.php?f=2&t=21716
The suggestion I got is to rely on "environment" option in settings.
I did try providing <environment> option and it didn't work. The value that I provided does not override with what is saved with the project.
In maven pom.xml file, I defined the environment in configuration section as follows-
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-pro-plugin</artifactId>
<version>4.5.1</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>Trading-soapui-project.xml</projectFile>
<junitReport>true</junitReport>
<exportAll>true</exportAll>
<outputFolder>${outputdir}</outputFolder>
<settingsFile>../Common/soapui-settings.xml</settingsFile>
<environment>QA</environment>
</configuration>
</execution>
</executions>
In the test case there is a Groovy test step that just prints the environment. Below is the simple Groovy script:-
def env = testRunner.testCase.testSuite.project.getActiveEnvironment().getName()
log.info "environment= ${env}"
This always prints the environment value with what is saved in the project. The value that we provided does not override. I saved the project with environment as "Production", so the
value displays as "Production" rather than "QA".
Can you please validate if this functionality is working.
Thanks in advance.