Forum Discussion

AAB's avatar
AAB
Regular Contributor
6 years ago
Solved

Assertions: check that number of response is bigger then 10

Hi,   Could someone tell me how  I could add an XPath that says: Response contains > 10 answers, not knowing what the answers are but one is expecting more then 10?   Thanks in advance, K...
  • richie's avatar
    6 years ago

    Hey AAB

    ah - when I responded I hadn't seen Nastya_Khovrina's response.

     

    The json count assertion works only for a specific value - you can't specify any maths operators like >, < to say that a node has >10 records in there - this was the first thing I checked when I saw your post.

     

    HOWEVER - the XPATH which Nastya_Khovrina has provided IS what you need - right?

     

    I did try and view the .xml you attached to identify the repeating groups so I could give you the specific XPATH relative to your file - however - I couldn't see any repeating groups when I viewed the file?!?!?!?!?!.

     

    Cheers,

     

    richie

     

  • AAB's avatar
    AAB
    6 years ago

    Nastya_Khovrina 

    Hi Nastya,

     

    For my environment apparently it's a little bit different. I do receive a JSON response but your notation doesn't give me the proper assertion. I could use the 'point and click' action in ReadyAPI that gives me this:

     

     

    Thanks for your help though!

     

    Kind regards,

    AboveAndBeyond.