Forum Discussion

Pritish_Panda's avatar
Pritish_Panda
Contributor
10 years ago

Automatically the path get changed while running soapui project through maven

Hi All, 

 

Scenario-:

1- I have a shell Script which i have stored inside a directory.

2- The path of the directory is set in the global property of SoapUI.

3- So I am trying to upload the Shell Script upload to remote server through a groovy script .

4- The logic is working fine when I am running the project directly through SoapUI.

5- When I am running the project through maven then I am getting an exception of File not found .

 

here the groovy script which was used to upload a shell script from local to remote  that groovy script is picking the wrong path wrong local path for shell script all though the shell script storage path is set in the global property .

 

 

Here is my pom file

 

<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.zaloni.bedrock</groupId>
<artifactId>integration-tests</artifactId>
<packaging>jar</packaging>
<version>4.2.0-SNAPSHOT</version>
<name>Integration Tests for Bedrock</name>
<url>https://wiki.zaloni.net/index.php?title=Bedrock_Test_Automation</url>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>

<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.42</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-pro-maven-plugin</artifactId>
<version>4.6.1</version>
<dependencies>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.9-RC1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.42</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>

<executions>
<!--add a new execution block with a different id for each new test xml file-->
<execution>
<phase>integration-test</phase>
<id>Bedrock-4-0-soapui-project.xml</id>
<configuration>
<projectFile>${pom.basedir}/Project_Names/Bedrock-4-0-soapui-project.xml</projectFile>
<junitReport>true</junitReport>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

 

 

Here is the exception what i am getting .'

 

java.io.FileNotFoundException: E:\SoapUI_Work\Bedrock_Automation_RestAPI\ShellScriptLib\PreLog_Execute.sh (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
at Remote_connection.uploadToRemote(Script1.groovy:82)
at Remote_connection$uploadToRemote.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at Script1.run(Script1.groovy:33)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:89)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
13:33:11,003 ERROR [log] Unable to Upload Data To Remote Server : An error occurred at uploadToRemote() : null

 

 

Behavior- "E:\SoapUI_Work\Bedrock_Automation_RestAPI\bedrock-qa\SOAP_UI_FrameWork_SanitySuite\ShellScriptLib"  is already set in global property  so Groovy script should take this path but  it take  "E:\SoapUI_Work\Bedrock_Automation_RestAPI/ShellScriptLib " this path so it basically skips 2 directory inside the path .

 

Path set in global property -"E:\SoapUI_Work\Bedrock_Automation_RestAPI\bedrock-qa\SOAP_UI_FrameWork_SanitySuite\ShellScriptLib"

 

Path is picking -"E:\SoapUI_Work\Bedrock_Automation_RestAPI/ShellScriptLib "

 

 

Any solution please .  

 

Thanks

 

 

 

 

 

2 Replies

  • Hello Pritish,

     

    Could you please share your Groovy script and a screenshot, showing Global Properties configuration?

     

    Thanks in advance! 

    • Pritish_Panda's avatar
      Pritish_Panda
      Contributor

      This issue is fixed now .There was a problem with my groovy script .I was using Mavenbase Dir to get the path so it was working well when I was running the project directly through soapui but creating problem when running the project through maven . So I changed my code.