Forum Discussion

Bishal's avatar
Bishal
Contributor
8 years ago

Data Driven Dynamic Test , Assertion value to limit up to certain number after decimal.

Hello,

I am fairly new to SOAP UI and i was hoping if someone can help me in test case setup as below scenario.

 

Step 1 - I make a call at ABC api and get value for node m = 123.4567245

Step 2 = I make a call at DEF api and get value for node p = 123.45672443. In this step, i have an assertion where i check node p = m ( which is the valid scenario ) in my case. This is dynamic assertion and can be changed based on input parameters. 

 

The problem i am facing is after nth number after the decimal values doesn't match in my calls which is expected ( as you can see above ). So, is there a way, where i can only compare upto 3-4 number after decimal in my assertion?.

 

Thanks

 

3 Replies

    • Bishal's avatar
      Bishal
      Contributor

      I am using Xpath Assertion in the second call to compare the data with the first call. 

       

      Xpath Expression:

      - Response from node m of the second call

       

      - Expected value 

      - This is value from the node p from the first call. They are exact value till nth number after decimal . ( so i need to compare it only to that value ). This is done with Get Data method. I want to see , if i can do the check till nth decimal here itself?

       

       

      Attached is the assertion error

       

      • nmrao's avatar
        nmrao
        Champion Level 3
        Well, like I mentioned earlier, use Script Assertion with help of given link.