Quantcast
Channel: [Q&A - FAQ Neotys] Last questions
Viewing all articles
Browse latest Browse all 2283

How to combine RegEx and variables in response validation?

$
0
0

I need to verify different responses for API calls. Call is switched between JSON and XML response record. Response should contain value previously collected from DB.

So, in JSON validated part of response looks like:

"documentId":2357751

in XML validated part of response looks like:

<documentId>2357751</documentId>

Value "2357751" is collected from database by SQL query and it is defined unde SQL variable that is called like:

${Document_Checklist.DOCUMENT_ID}

Merging validation requests to fit both XML and JSON record, validation should look like:

documentId[\"|\>][\:]*[\"]*2357751

Since mentioned value is dynamically changed by SQL request, I have tried to post validation as:

documentId[\"|\>][\:]*[\"]*${Document_Checklist.DOCUMENT_ID}

And that is the breaking point validation has failed... I have even tried to add literal char marks to RegEx, like this:

documentId[\"|\>][\:]*[\"]*\$\{Document_Checklist\.DOCUMENT_ID\}

... but no gain. Please help!


Viewing all articles
Browse latest Browse all 2283

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>