Retry Soap Client request

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in SOAtest
Retrying a web-service request based on a value in the response.
We have a requirement to wait an abitrary time for a web-service request to be processed.

The scenario is:

1. a requestMap web-service places the request on the JMS queue
* A map may take upto 10 minutes to produce. These large requests are queued, so that two of them are processed concurrently.

2. an isMapAvailable web-service checks of the map is ready yet.
* the response contains an availableStatus element, which is one of (PROCESSING, AVAILABLE, UNAVAILABLE)
.... - PROCESSING = the map is being produced
.... - AVAILABLE = the map is finished, ready to download
.... - UNAVAILABLE = the requested map cannot be produced.
* Our client web-app loops, calling isMapAvailable until availableStatus != PROCESSING
.... - it then downloads the map or shows an error page as appropriate

3. the downloadMap web-service downloads the map and displays it = SUCCESS

But in SOATest, I can't figure out how to implement (pseudocode):
while (isMapAvailable() == PROCESSING) { sleep(1000) }


I've tried doing with with python scripts and test-variables, but it appears the design of SOATest scripting makes this difficult and complicated, and therefore not worth doing. <aside>Our business people need to be able to run/maintain our SoaTests, so we need to keep it simple.</aside>

I'm imagining a new "Retry While" sub-panel on the tab: Scenario ~ ExecutionOptions ~ TestFlowLogic ... I've uploaded a mockup as an attachment.

Thanking you. Keith.
Tagged:

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Good morning Keith,

    There is already a delay option implemented within the Execution Options > Test Flow Logic tab. By using the "Delay after test execution" field, you can inject delay after a test is run, which will persist over its multiple iterations (when used in conjunction with looping via Test Variables).

    I have included a .tst file that demonstrates this functionality. To provide a rough similarity with your testing setup, I have three tests. The first test merely acts as your requestMap service, in that it is only executed once. The second test emulates isMapAvailable, and loops until a specific value is reached (done via paramaterizing). The third test is, a rough representation of your downloadMap service, and is only run once after the correct value from test 2 was received. Please look into the Execution Option > Test Flow Logic under "Scenario: ICalculator" to see what I did.

    If this does not meet your requirements, or is not what you're looking for, please respond with more clarification on the setup of your test.

    Regards,
    Joseph
  • LegacyForumLegacyForum Posts: 1,669 ✭✭

    There is already a delay option implemented within the Execution Options > Test Flow Logic tab. By using the "Delay after test execution" field, you can inject delay after a test is run, which will persist over its multiple iterations (when used in conjunction with looping via Test Variables).
    ....

    Joseph,

    You sir, are a legend!

    I admit that I haven't looked (or thought about) at your response until now, I've been otherwise engaged ;-) I just plugged my map-requests straight into your TestDelay.tst and it works like a charm.

    It's simple and effective. I tips me lid to ya'.

    Thanx. Keith.
Sign In or Register to comment.