Forum Discussion

vervuwi's avatar
vervuwi
New Contributor
8 years ago

Defect: JSON Path Expressions can no longer handle inline data fetches

We have a response from a REST service with the following json structure:

 

 

{"users": [
	{
		"email": "user1@test.com",
		"userId": "..."
	},
	{
		"email": "user2@test.com",
		"userId": "..."
	}
]}

 

We also have a test step called 'GenerateData' that has a property that actually contains the email of the user we are currently using in this test. When we try to extract his userId with the following JSON Path Expression we always recieve an empty result. We are 100% positive that the '${GenerateData#userEmail}' contains 'user1@test.com' while our test is executing.

 

$.users[?@.email='${GenerateData#userEmail}'].userId

 

In readyAPI 1.6.0 this feature was still working. However we recently upgraded to release 1.7.0 and we now notice that test cases that make use of this sort of JSONPath Expressions actually fail.  

 

Is this a wanted change in version 1.7.0 or a newly introduced bug?

In case there are any reasonable work arounds available, feel free to share them.

 

Thanks in advance.

4 Replies

    • vervuwi's avatar
      vervuwi
      New Contributor

      I have just tried this with the nightly build and this issue is still occurring.

      Since we run our test cases on a build server we also prefer to install release builds of the product

      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Thanks for checking this!

        I've reported the issue to our R&D Team. Once I get some news from them, I'll post it here.