Poll API or DB for status change
In one of the test case we wait for Db column “STATUSID” to change its value from 800 to 900 and
it takes a little while to get the changed value, so how can we poll the db for the changes?Also we have restful api which returns response with the same “STATUSID” is it also possible to poll api until we get the changed “STATUSID”
Either way is fine to us.
Could you please help?
Comments
-
Both cases are similar so I will describe a simple scenario how can you poll the service for changes.
1. Add Diff tool to response traffic. The expected body in your case might be:
{
"STATUSID" : 900
}
2. The test should be in its own Test Suite to control flow logic.
3. Go to this parent Test Suite -> Execution Options -> Test Flow Logic and set
a) Maximum number of loops: {number of requests to server/db}
b) Loop until Every test Succeds
c) in the left panel choose your test and set delay before or after each test
The test will be executed until the STATUSID is 900.
I hope I helped you.1 -
Few other examples you can see here or here or here
--
Ireneusz Szmigiel
http://www.catb.org/esr/faqs/smart-questions.html0