i have created one table in my sql. i have created one 1 api json response which is coming from my local machine.
now i need to compare response values with databases values as loop.how to do that ?
I add assertion in the request itself.but its comparing all the json values with the last updated mysql database value.
Solved! Go to Solution.
You can supply a fixed value, but if you're testing the API response matches the datasource value, you should be able to right-click in expected value cell and from the context menu, select Get Data. Get Data allows you to select a value from anywhere within SoapUI (it's a brilliant little feature). You could also specify the expected response from your datasource. E.g. {DatasourceStep#value}.
Might be a bit of a pain, but it's Groovy free. Personally, when managing multiple entries in a single response and rows form a db and looping is required, I'd be more inclined to use Groovy.
Hi,
I genuinely cannot think how you might achieve this without any Groovy scripting. With scripting, it shouldn't be too difficult.
I'd be interested to see what the other contributors come up with...
Chris
Hi @Arunachalam_RM,
If you have readyapi (Licensed version) then there is one assertion "Mesage Content Assertion", there you can use property transfer to check and configure the values from the Datasource and the response dynamically.
every response field ,we need to dynamically set right? (it willl take lot of time?)if i am setting it is taking last value from database
every field response we need to set the value ah?
You can supply a fixed value, but if you're testing the API response matches the datasource value, you should be able to right-click in expected value cell and from the context menu, select Get Data. Get Data allows you to select a value from anywhere within SoapUI (it's a brilliant little feature). You could also specify the expected response from your datasource. E.g. {DatasourceStep#value}.
Might be a bit of a pain, but it's Groovy free. Personally, when managing multiple entries in a single response and rows form a db and looping is required, I'd be more inclined to use Groovy.
Hi @Arunachalam_RM,
if your query is resolved please mark it as solved, if not then please reiterate your question
Can u share some groovy to compare API responses against dB?
Subject | Author | Latest Post |
---|---|---|