Forum Discussion

Lagencie's avatar
Lagencie
Frequent Contributor
7 years ago

Variables in JSON Schema Compliant Assertion Steps doesnt work with data sources

The subject pretty much sums it up but for a little more details:

 

When you create a test case with a data source, a test step and a data source loop and within the test step you use the Assertion JSON Schema compliance with a path using a variable like ${DataCollection#CollectionEntry} so for example: www.google.com/${DataCollection#CollectionEntry}.json (doesn't work this way but just as an example) so it uses, depending on the collection Entry, different JSON schema files it only initializes the JSON schema file for the first data source element it runs and then somehow buffers the JSON schema file for the next assertions.

 

In the example of having a data source with 2 values (test and test2) it opens the JSON schema

www.google.com/test.json and on the 2nd loop it compares the response again with www.google.com/test.json instead of getting the new JSON schema test2

 

When you click on the JSON schema compliance test step after the test case and just press ok without changing anything it takes the new JSON schema from the path with the right data source ... so it only loads the JSON schema once on creating the assertion, rather than on every assertion

1 Reply

  • LexiAQA's avatar
    LexiAQA
    SmartBear Alumni (Retired)

    Hi Lagencie,

     

    What Ready! API version are you using? There was a known issue with JSON Schema Compliance Assertion in the Ready! API 2.0.0 release build. This problem has been fixed in one of the later maintenance builds. Now, the fix is included in the latest Ready! API 2.0.2. Could you please try using the latest product version? Do you face the problem with Ready! API 2.0.2?