Ask a Question

ReadyApi JSONPath match assertion with Wildcard

SOLVED
Behdad
Occasional Contributor

ReadyApi JSONPath match assertion with Wildcard

Hi 

I am using ReadyAPI 3.6.0 and a bit new on it 🙂

In some test steps, i like to use wild card in Jsonpath Match Assertion for content , but i don't know How to define wildcard ?  Let me share a simple example:

I have some REST endpoints with Json format to test, so in Teststep , I expect some response error messages start with "BAD_REQUEST::VALUE_FORMAT" followed by the name of the key 

in this case i think i have two option :

1- Use wild card like this "BAD_REQUEST::VALUE_FORMAT * " and it means that all similar messages end with * (key name) would be PASS/accepted

2- Define OR with various messages that i expect to see like 

BAD_REQUEST::VALUE_FORMAT-Key1 OR BAD_REQUEST::VALUE_FORMAT-Key2 ......

 

Actually i cant manage to define none of them ... in this case would you please help me on it ?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
richie
Community Hero

Re: ReadyApi JSONPath match assertion with Wildcard

Hey @Behdad

Json match content assertions support using wildcards and there is a 'allow wildcards' checkbox on the assertion form to enable them.

So "BAD_REQUEST::VALUE_FORMAT *" should work fine as long as you enable the wildcards function.

Im guessing you wouldve noticed thr checkbox so can you provide screenshots of your assertion form so we can see what youre doing and what error youre getting?

Cheers

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

3 REPLIES 3
richie
Community Hero

Re: ReadyApi JSONPath match assertion with Wildcard

Hey @Behdad

Json match content assertions support using wildcards and there is a 'allow wildcards' checkbox on the assertion form to enable them.

So "BAD_REQUEST::VALUE_FORMAT *" should work fine as long as you enable the wildcards function.

Im guessing you wouldve noticed thr checkbox so can you provide screenshots of your assertion form so we can see what youre doing and what error youre getting?

Cheers

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

sonya_m
Community Manager

Re: ReadyApi JSONPath match assertion with Wildcard

Hi @Behdad ! Please let us know if Richie's reply was helpful!


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
nmrao
Community Hero

Re: ReadyApi JSONPath match assertion with Wildcard

Screen shot please?

May be wanted to try simple contains assertion rather than JsonPath Match.


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: