Service Virtualization

  • 1.  Ensure Property matches Expression Assertion

    Posted Jul 07, 2017 08:37 AM

    Hi Monika , 

     

    I have a JSON response element  :  "paymentTransactionId": "234579169", and using a JSON filter to store the element value to a property variable "TransId". It contains 9 digits, when i gave with regular expression assertion is not getting fired. please let me know how to use this assertion in devtest 8.2.

     



  • 2.  Re: Ensure Property matches Expression Assertion

    Posted Jul 07, 2017 10:48 AM

    Does the documentation for the assertion help?

    https://docops.ca.com/devtest-solutions/8-2/en/reference/assertion-descriptions/other-assertions/ensure-property-matches-expression-assertion

    Also, note that DevTest Workstation has a regular expression helper (Help > Regular Expression Helper).



  • 3.  Re: Ensure Property matches Expression Assertion

    Posted Aug 23, 2017 10:38 AM

    helper is not working



  • 4.  Re: Ensure Property matches Expression Assertion

    Posted Jul 11, 2017 04:31 AM

    Yes i referred the above help on assertion . But it does not help me . The above assertion is not getting fired.Please let me know what i am missing here 

     

     



  • 5.  Re: Ensure Property matches Expression Assertion

    Posted Jul 11, 2017 06:46 PM

    Hello Raheswari,

     

    Assertions are executed in the order they are available in the step.

    If a previous assertion was fired and the flow of your test case changed, it won't analyze the next assertions.

    If that is the case, try to reorder your assertions in the test step and verify.

     

    Hope it helps.

    Heloisa



  • 6.  Re: Ensure Property matches Expression Assertion

    Posted Aug 23, 2017 10:38 AM

    Thanks a lot . This helped 



  • 7.  Re: Ensure Property matches Expression Assertion

    Posted Jul 12, 2017 08:32 AM

    Hi Raheswari,

    Did Heloisa's response help you out with this issue?



  • 8.  Re: Ensure Property matches Expression Assertion

    Posted Jul 13, 2017 05:42 AM

    Hi Rajeswari,

     

    I assume your issue would have been resolved now.

    If you still facing issue that assertion is being fired but it is validating to 'False' each time.

    As per your screenshot ,Reg exprsn is [0-9][9]

     

    We can see that your Reg exprsn is incorrect, it should be [0-9]{9}. It should be curly bracket( '{ }') for defining the character length limit not square bracket( ' [ ] ').

     

    I hope it helps.

     

    Thanks,

    Dinesh Kumar



  • 9.  Re: Ensure Property matches Expression Assertion

    Posted Aug 23, 2017 10:39 AM

    Thanks a lot dinesh



  • 10.  Re: Ensure Property matches Expression Assertion

    Posted Aug 23, 2017 10:43 AM

    Can you please explain the difference [with examples] for the below two types. Its bit confusing . Appreciate if you could explain with examples for both the types

    Ensure Property Matches Expression Assertion and 

    Ensure Result Contains Expression Assertion 

    I need to check for the below values [either can come in response]

    PL suggest a best way of assertion to check fr the below values in a web service response 

    XSAMN920TB32

    610214653208



  • 11.  Re: Ensure Property matches Expression Assertion

    Posted Aug 24, 2017 02:51 AM

    Hi Rajeswari,

     

    Ensure Property Matches Expression: This gives you freedom of applying assertion on any LISA property(default or user created you want.

    While,

    Ensure Result Contains Expression: This by default applies on {{stepname.rsp}} property of step.

     

    Function for both are same to look-up for Expression provided.

     

    For your second question:

    1- If you looking for fixed value in response, use Regular expression: " XSAMN920TB32 |

    610214653208 "

    2- If you need to look for regular expression, use:" [expressionforfirstvalue] | [expressionforsecondvalue] ".

     

    Please check if this helps.

     

    Thanks,

    Dinesh Kumar