Forum Discussion

vervuwi's avatar
vervuwi
New Contributor
9 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.