IBM_-_PA_Suppor
11 years agoOccasional Contributor
[Resolved]GroovyUtils.projectPath returns empty string
I have searched the forums and although this http://forum.loadui.org/viewtopic.php?f=2&t=17719 comes the closest - there was no resolution. But I have a similar problem.
I have a groovy script which when I execute in SOAPUI Pro (v4.6.4) it works perfectly fine. However, when I run it on the command-line using the maven plugin (pro version 4.6.1) the GroovyUtils.projectPath returns an empty string. Can you kindly help?
Here is the code:
Here is my pom.xml:
Here is the screenshot from within SOAPUI:
Here is the maven command with the results. I have X'd out sensitive information and in red you can see the empty string.
mvn -X -f com.smartbear.soapui:soapui-pro-maven-plugin:4.6.1:test
SoapUI Pro 4.6.1 Maven2 TestCase Runner
Setting soapui.logroot value ./logging/
10:10:52,562 WARN [SoapUI] Missing folder [C:\Users\IBM_ADMIN\workspace\2xAutomation\BWS\.\ext] for external libraries
10:10:52,733 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\IBM_ADMIN\soapui-settings.xml]
10:10:52,893 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\Program Files (x86)\SmartBear\soapUI-Pro-4.6.0\bin\scripts]
10:10:54,090 INFO [WsdlProject] Loaded project from [file:/C:/Users/IBM_ADMIN/workspace/2xAutomation/BWS/./testScripts/BWS_Regression_Suite_Master_soapui.xml]
10:10:54,335 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\Program Files (x86)\SmartBear\soapUI-Pro-4.6.0\bin\scripts]
10:10:56,936 INFO [SoapUIProTestCaseRunner] Setting project property [projName] to [BWS_Regression_Suite_Master_soapui]
10:10:56,939 INFO [SoapUIProTestCaseRunner] Running SoapUI tests in project [BWS_Regression_Suite_Master_soapui]
10:10:56,943 INFO [SoapUIProTestCaseRunner] Running Project [BWS_Regression_Suite_Master_soapui], runType = SEQUENTIAL
10:10:56,963 INFO [SoapUIProTestCaseRunner] Running SoapUI testcase [64617 POST /save with Strings]
10:10:56,970 INFO [SoapUIProTestCaseRunner] running step [Get Token autoUser31]
10:10:57,066 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
10:10:57,068 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /api/oauth/token?client_id=2xApp&grant_type=password&username=XXX&password=XXX%23&client_secret=XXX&user_oauth_approval=true HTTP/1.1
10:10:57,179 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
10:10:57,184 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
10:10:57,474 INFO [SoapUIProTestCaseRunner] Assertion [XPath Match] has status VALID
10:10:57,476 INFO [SoapUIProTestCaseRunner] Assertion [Invalid HTTP Status Codes] has status VALID
10:10:57,480 INFO [SoapUIProTestCaseRunner] running step [oauthToken to TestCase]
10:10:57,530 INFO [SoapUIProTestCaseRunner] running step [GET /count]
10:10:57,537 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
10:10:57,538 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: GET /api/onboard/v1/tasks/onboarding/count HTTP/1.1
10:10:58,209 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
10:10:58,212 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
10:10:58,217 INFO [SoapUIProTestCaseRunner] Assertion [Invalid HTTP Status Codes] has status VALID
10:10:58,220 INFO [SoapUIProTestCaseRunner] Assertion [XPath Match] has status VALID
10:10:58,223 INFO [SoapUIProTestCaseRunner] running step [count]
10:10:58,227 INFO [SoapUIProTestCaseRunner] running step [check count]
10:10:58,514 INFO [SoapUIProTestCaseRunner] running step [Run TestCase 1]
10:10:58,566 INFO [log] Project Path is =
10:10:58,570 INFO [SoapUIProTestCaseRunner] Finished running SoapUI testcase [64617 POST /save with Strings], time taken: 1231ms, status: FINISHED
10:10:58,572 INFO [SoapUIProTestCaseRunner] Project [BWS_Regression_Suite_Master_soapui] finished with status [FINISHED] in 1625ms
SoapUI 4.6.1 TestCaseRunner Summary
-----------------------------
Time Taken: 1632ms
Total TestSuites: 1
Total TestCases: 1 (0 failed)
Total TestSteps: 6
Total Request Assertions: 4
Total Failed Assertions: 0
Total Exported Results: 0
10:10:58,952 INFO [SoapUIProTestCaseRunner] Created report at file:/C:/Users/IBM_ADMIN/workspace/2xAutomation/BWS/testReports/index.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.925s
[INFO] Finished at: Wed Feb 12 10:10:58 EST 2014
[INFO] Final Memory: 259M/700M
[INFO] ------------------------------------------------------------------------
I have a groovy script which when I execute in SOAPUI Pro (v4.6.4) it works perfectly fine. However, when I run it on the command-line using the maven plugin (pro version 4.6.1) the GroovyUtils.projectPath returns an empty string. Can you kindly help?
Here is the code:
groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
projectPath = groovyUtils.projectPath
log.info ("Project Path is =" + projectPath )
Here is my pom.xml:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.smartbear.soapui</groupId>
<artifactId>bws-smoke-suite</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 soapUI Test</name>
<url>http://maven.apache.org</url>
<pluginRepositories>
<pluginRepository>
<id>SmartBear Sweden Plugin Repository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-pro-maven-plugin</artifactId>
<version>4.6.1</version>
<configuration>
<projectFile>./testScripts/BWS_Regression_Suite_Master_soapui.xml</projectFile>
<outputFolder>./testReports</outputFolder>
<junitReport>true</junitReport>
<printReport>true</printReport>
<soapuiProperties>
<property>
<name>soapui.logroot</name>
<value>./logging/</value>
</property>
</soapuiProperties>
<projectProperties>
<projectProperty>projName=BWS_Regression_Suite_Master_soapui</projectProperty>
</projectProperties>
</configuration>
<executions>
<execution>
<id>test1</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Here is the screenshot from within SOAPUI:
Here is the maven command with the results. I have X'd out sensitive information and in red you can see the empty string.
mvn -X -f com.smartbear.soapui:soapui-pro-maven-plugin:4.6.1:test
SoapUI Pro 4.6.1 Maven2 TestCase Runner
Setting soapui.logroot value ./logging/
10:10:52,562 WARN [SoapUI] Missing folder [C:\Users\IBM_ADMIN\workspace\2xAutomation\BWS\.\ext] for external libraries
10:10:52,733 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\IBM_ADMIN\soapui-settings.xml]
10:10:52,893 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\Program Files (x86)\SmartBear\soapUI-Pro-4.6.0\bin\scripts]
10:10:54,090 INFO [WsdlProject] Loaded project from [file:/C:/Users/IBM_ADMIN/workspace/2xAutomation/BWS/./testScripts/BWS_Regression_Suite_Master_soapui.xml]
10:10:54,335 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\Program Files (x86)\SmartBear\soapUI-Pro-4.6.0\bin\scripts]
10:10:56,936 INFO [SoapUIProTestCaseRunner] Setting project property [projName] to [BWS_Regression_Suite_Master_soapui]
10:10:56,939 INFO [SoapUIProTestCaseRunner] Running SoapUI tests in project [BWS_Regression_Suite_Master_soapui]
10:10:56,943 INFO [SoapUIProTestCaseRunner] Running Project [BWS_Regression_Suite_Master_soapui], runType = SEQUENTIAL
10:10:56,963 INFO [SoapUIProTestCaseRunner] Running SoapUI testcase [64617 POST /save with Strings]
10:10:56,970 INFO [SoapUIProTestCaseRunner] running step [Get Token autoUser31]
10:10:57,066 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
10:10:57,068 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /api/oauth/token?client_id=2xApp&grant_type=password&username=XXX&password=XXX%23&client_secret=XXX&user_oauth_approval=true HTTP/1.1
10:10:57,179 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
10:10:57,184 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
10:10:57,474 INFO [SoapUIProTestCaseRunner] Assertion [XPath Match] has status VALID
10:10:57,476 INFO [SoapUIProTestCaseRunner] Assertion [Invalid HTTP Status Codes] has status VALID
10:10:57,480 INFO [SoapUIProTestCaseRunner] running step [oauthToken to TestCase]
10:10:57,530 INFO [SoapUIProTestCaseRunner] running step [GET /count]
10:10:57,537 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
10:10:57,538 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: GET /api/onboard/v1/tasks/onboarding/count HTTP/1.1
10:10:58,209 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
10:10:58,212 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
10:10:58,217 INFO [SoapUIProTestCaseRunner] Assertion [Invalid HTTP Status Codes] has status VALID
10:10:58,220 INFO [SoapUIProTestCaseRunner] Assertion [XPath Match] has status VALID
10:10:58,223 INFO [SoapUIProTestCaseRunner] running step [count]
10:10:58,227 INFO [SoapUIProTestCaseRunner] running step [check count]
10:10:58,514 INFO [SoapUIProTestCaseRunner] running step [Run TestCase 1]
10:10:58,566 INFO [log] Project Path is =
10:10:58,570 INFO [SoapUIProTestCaseRunner] Finished running SoapUI testcase [64617 POST /save with Strings], time taken: 1231ms, status: FINISHED
10:10:58,572 INFO [SoapUIProTestCaseRunner] Project [BWS_Regression_Suite_Master_soapui] finished with status [FINISHED] in 1625ms
SoapUI 4.6.1 TestCaseRunner Summary
-----------------------------
Time Taken: 1632ms
Total TestSuites: 1
Total TestCases: 1 (0 failed)
Total TestSteps: 6
Total Request Assertions: 4
Total Failed Assertions: 0
Total Exported Results: 0
10:10:58,952 INFO [SoapUIProTestCaseRunner] Created report at file:/C:/Users/IBM_ADMIN/workspace/2xAutomation/BWS/testReports/index.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.925s
[INFO] Finished at: Wed Feb 12 10:10:58 EST 2014
[INFO] Final Memory: 259M/700M
[INFO] ------------------------------------------------------------------------