Forum Discussion
elysialock
10 years agoOccasional Contributor
So... what if I need to use a wildcard in my assertions then? Say, for example, I have a test that sends user credentials and the response returns a username. I set the username as a project-level property, which means I can vary the username from test run to test run. I may first choose to run the test with userA, then again with userB. With my understanding of JSON assertions, I'm not sure how to
In the past, I used XML assertions to check for the presence of that element (username) without checking for the specific username by using a wildcard for the <username> field, like this:
<response>
<color>red</color>
<username>*</username>
</response>
In the past, I used XML assertions to check for the presence of that element (username) without checking for the specific username by using a wildcard for the <username> field, like this:
<response>
<color>red</color>
<username>*</username>
</response>
SmartBear Support wrote: Hi,
I see that you are using a REST webservice, I would suggest you to use Json path since namespaces can be ignored in json. Also I will try to reproduce the issue.
Thanks,
Jeshtha
Related Content
Recent Discussions
- 2 days agogroovyguy