Ask a Question

How to use relative path for keystore (WS-Security Configuration)

SOLVED
Happy
Contributor

How to use relative path for keystore (WS-Security Configuration)

 Hello,

 

I use .p12 keystore for tests in SoapUI Pro. I add keystore and absolute path set automatically. (locally test works fine)

But when I run test on Jenkins I get error - No such file or directory. How I can set relative path for keystore?

10 REPLIES 10
TanyaYatskovska
SmartBear Alumni (Retired)

Hi,

 

Have you tried to use ${projectDir} in the path?

 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



How I can add ${projectDir} in the path? I can't change path in Source field (Keystores).

TanyaYatskovska
SmartBear Alumni (Retired)

Hi,

 

You are right. It looks like only full path to files are allowed. Might be this is ok as such files are usually stored in one common place where everyone has access to.

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



May be it's worthy trying property expansion.
Say define a property, say LOCATION_KEYS and put a value there, at project level and use ${#Project#LOCATION_KEYS}

You may need to use unix file separator i.e., '/' even on windows while providing path.


Regards,
Rao.

I run test on Jenkins, and there absolute path for certificate does not work. Error -No such file or directory

 

I set the SSL Keystore and password programmatically

import com.eviware.soapui.settings.SSLSettings
import com.eviware.soapui.SoapUI 

// set
SoapUI.settings.setString( SSLSettings.KEYSTORE, pathToKeystore )
SoapUI.settings.setString( SSLSettings.KEYSTORE_PASSWORD, keystorePassword )

// get
SoapUI.settings.getString( SSLSettings.KEYSTORE, "value to return if there is no such setting set" )

https://www.soapui.org/scripting-properties/tips-tricks.html 

PiotrG
Occasional Contributor

There is quite similar situation with access to keystores when you are using absolute paths in universal (file:///c:/...) format. Ready! API 1.6 (20160215-1916) can't read it. It starts to work when path is back to clear WinStyle - c:/....

 

Other thing is with mocks using WSS and keystores which you deploy on application server (i.e. Tomcat). It can't access it using relative or relative with ${projectDir} paths even if it is located in the same folder as the soapUI project file.

Raveena
New Contributor

Even i am getting error as "File not found" in Jenkins, when it is trying to access the project level property in ReadyAPI stored with the file path. PFA the project property screenshot. 

 

Error that i am getting is :

 

10:41:28 10:41:28,241 ERROR [errorlog] java.lang.AssertionError: XML schema validation failed. Error Message: Required XSD File was not found. Expression: (msgInfo == ). Values: msgInfo = Required XSD File was not found
10:41:28 java.lang.AssertionError: XML schema validation failed. Error Message: Required XSD File was not found. Expression: (msgInfo == ). Values: msgInfo = Required XSD File was not found
10:41:28 	at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:404)
10:41:28 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:650)
10:41:28 	at Script1.run(Script1.groovy:13)
10:41:28 	at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)
10:41:28 	at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82)
10:41:28 	at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:164)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:259)
10:41:28 	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:50)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:169)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:1)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
10:41:28 	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
10:41:28 	at java.util.concurrent.FutureTask.run(Unknown Source)
10:41:28 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
10:41:28 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
10:41:28 	at java.lang.Thread.run(Unknown Source)
10:41:28 java.lang.AssertionError: XML schema validation failed. Error Message: Required XSD File was not found. Expression: (msgInfo == ). Values: msgInfo = Required XSD File was not found
10:41:28 	at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:404)
10:41:28 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:650)
10:41:28 	at Script1.run(Script1.groovy:13)
10:41:28 	at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)
10:41:28 	at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82)
10:41:28 	at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:164)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:259)
10:41:28 	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:50)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:169)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:1)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
10:41:28 	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
10:41:28 	at java.util.concurrent.FutureTask.run(Unknown Source)
10:41:28 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
10:41:28 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
10:41:28 	at java.lang.Thread.run(Unknown Source)
10:41:28 10:41:28,251 ERROR [SoapUIProTestCaseRunner] Groovy Script for xml schema validation failed, exporting to 

  Kindly let me know if this issue is resolved and its resolution.

Raveena
New Contributor

Even i am getting error as "File not found" in Jenkins, when it is trying to access the project level property in ReadyAPI stored with the file path. PFA the project property screenshot. 

 

Error that i am getting is :

 

10:41:28 10:41:28,241 ERROR [errorlog] java.lang.AssertionError: XML schema validation failed. Error Message: Required XSD File was not found. Expression: (msgInfo == ). Values: msgInfo = Required XSD File was not found
10:41:28 java.lang.AssertionError: XML schema validation failed. Error Message: Required XSD File was not found. Expression: (msgInfo == ). Values: msgInfo = Required XSD File was not found
10:41:28 	at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:404)
10:41:28 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:650)
10:41:28 	at Script1.run(Script1.groovy:13)
10:41:28 	at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)
10:41:28 	at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82)
10:41:28 	at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:164)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:259)
10:41:28 	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:50)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:169)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:1)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
10:41:28 	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
10:41:28 	at java.util.concurrent.FutureTask.run(Unknown Source)
10:41:28 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
10:41:28 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
10:41:28 	at java.lang.Thread.run(Unknown Source)
10:41:28 java.lang.AssertionError: XML schema validation failed. Error Message: Required XSD File was not found. Expression: (msgInfo == ). Values: msgInfo = Required XSD File was not found
10:41:28 	at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:404)
10:41:28 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:650)
10:41:28 	at Script1.run(Script1.groovy:13)
10:41:28 	at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)
10:41:28 	at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82)
10:41:28 	at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:164)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:259)
10:41:28 	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:50)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:169)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:1)
10:41:28 	at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
10:41:28 	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
10:41:28 	at java.util.concurrent.FutureTask.run(Unknown Source)
10:41:28 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
10:41:28 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
10:41:28 	at java.lang.Thread.run(Unknown Source)
10:41:28 10:41:28,251 ERROR [SoapUIProTestCaseRunner] Groovy Script for xml schema validation failed, exporting to 

  Kindly let me know if this issue is resolved and its resolution.

cancel
Showing results for 
Search instead for 
Did you mean: