Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Poll API or DB for status change

asingh
asingh Posts: 14
  1. 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?

  2. 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

  • mniesciur
    mniesciur Posts: 6

    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.

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭

    Few other examples you can see here or here or here

    --
    Ireneusz Szmigiel
    http://www.catb.org/esr/faqs/smart-questions.html