Forum Discussion

Nagravision_SA__1's avatar
10 years ago

JsonPath Assertion creation not available without payload

Hello,

Our test team would like to write REST test cases based on the contract (WADL) before having access to any implementation but
all JsonPath assertion menu (content regexp ...) are disabled if there is no JSON payload in the rest call answer.

we have not this limitation with Xpath assertion but the the API will return only JSON.

Is this a bug (tested with SOAPUI PRO version 5.1.2) ?
Do we have any workaround ?

Thanks.

6 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Yes, this seems like a bug. As a workaround create a REST mock service and have the service return JSON content. Then the JSON assertions should be enabled to add.


    Regards,
    Marcus
    SmartBear Support
  • vvvvaib's avatar
    vvvvaib
    Occasional Contributor

    Still same in 5.3.0. Cannot create a JsonPath assertions if the test step is not run at least once.

    • JoanLi's avatar
      JoanLi
      New Contributor

      I meet the same problem. In order to complete the task on time, I open the request in the test case , then change the "resource/Method"value(choose one can open and has JsonPath assertion), I find the Jsonpath assertion creation is available. I add the Jsonpath assertion then change the "resource/Method"value back, the last save the project.

      • skyhigh's avatar
        skyhigh
        Contributor

        JoanLi,

         

        I'm having the same problem where JsonPath Match is not selectable and I'm trying to follow your workaround, but unable to get it started.  Can you elaborate little bit more when you said "I open the request in the test case".  I'm lost because I don't know what request you're referring to. thanks.