cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error com/jayway/jsonpath/spi/JsonProvider

Highlighted
Occasional Contributor

Getting error com/jayway/jsonpath/spi/JsonProvider

Hi,

 

I have written Customized code to run SOAPUI Test Suites and publish result.

The Code is working fine for HHTP Steps and Property Transfer related to XPath.

But when same Code was ran against REST Steps and Property Transfer step related to JSONPath. Then getting error.

 

SOAPUI Version 5.3.0

Java Version 1.7

POM details

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path -->
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.2.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.1.0</version>
</dependency>

<repositories>
<repository>
<id>smartbear</id>
<name>smartbear repository</name>
<url>http://smartbearsoftware.com/repository/maven2</url>
</repository>
</repositories>

 

PropertyTransfer for JSONPath where Source is RestStep Response and Target is TestSuite Property

PropertyTransfer.png

Test Case is run using TestCase Runner

TestCaseRunner runner = testCase.run(new PropertiesMap(), false);

 

Then this Method captures Property Transfer Result details

public void runPropertyTransfer(PropertyTransferResult transferresult)
{
for (int c = 0; c < transferresult.getTransferCount(); c++) {
PropertyTransferConfig transfer = transferresult.getTransferAt(c);
stepRequest = stepRequest + "Transfer name: " + transfer.getName() + " Source Step: " + transfer.getSourceStep() + " Source Property: " + transfer.getSourceType() + " Source Path: " + transfer.getSourcePath() + " Type : " + transfer.getType() +
" Target Step: " + transfer.getTargetStep() + " Target Path: " + transfer.getTargetPath() + " Tagert Property: " + transfer.getTargetType() + "\n";
stepResponse = stepResponse + "Transfer name: " + transfer.getName() + " Transfer value: " + Arrays.toString(transferresult.getTransferredValuesAt(c)) + "\n";
}
execMillis = transferresult.getTimeTaken();
status = transferresult.getStatus().toString();
message = getErrorDetails(transferresult.getMessages());
}

 

Error : -

2018-03-20 11:25:15 - Exception during Test Execution
java.lang.NoClassDefFoundError: com/jayway/jsonpath/spi/JsonProvider
at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.readSourceValue(PropertyTransfer.java:345)
at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.transferProperties(PropertyTransfer.java:315)
at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:125)
at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:103)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:213)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:139)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:77)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:592)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:77)

 

 

Can anyone help me

SOAPUI is looking for com/jayway/jsonpath/spi/JsonProvider.java file but when checked in com.jayawy.jsonpath jar found out that it is in this location com/jayway/jsonpath/spi/json/JsonProvider.java.

Am I doing something wrong here?

Building with the Collaborator API

Help Documenation
The Collaborator API is a JSON-RPC API that lets you integrate with Collaborator 9.0 and above. For more information about how the API works, check out the API description here:


Sample Plugins
For an example of an add-in that uses the API, take a look at the Microsoft Word Add-in for Collaborator:


We list all the great plugins our network has already built on this page on the SmartBear website.

Description

Meet the Community Leaders!

SmartBear Connect is an excellent opportunity for training, in-person support, and networking.

GET YOUR TICKET WITH $100 OFF