Ask a Question

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

Bishal
Contributor

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 3
nmrao
Community Hero

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

Now sure how you are comparing or what type of assertion. If you consider to use Script Assertion, then check this thread:
http://mrhaki.blogspot.in/2010/01/groovy-goodness-round-and-truncate.html


Regards,
Rao.
Bishal
Contributor

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

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
Community Hero

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

Well, like I mentioned earlier, use Script Assertion with help of given link.


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