Need to wait for all requests to complete before submitting a request

Locked Need to wait for all requests to complete before submitting a request

  • 2012年8月17日 13:19
     
     

    Hi,

    I have a web performance test with say about 5 requests. When I run the same, the following scenario occurs:

    Request 1 -> 200 OK

    Request 2 -> 200 OK

    Request 3 -> 200 OK

    Request 4 -> Submitting...

    Request 5 -> Failed due to some extraction (this is because Request 4 has not completed)

    I have added a WebTestRequestPlugin and made the Request 5 wait static for 10 seconds (system.threading.thread.sleep(10000) in PreRequest event.

    My question: How can i programatically wait for all requests to complete or atleast a particular request to complete? I tried using e.response.status and all that. did not work.

    please assist.

すべての返信

  • 2012年8月20日 1:33
    モデレータ
     
     

    Hi checkoutsree,

    Thank you for your post.

    If you want to wait for all requests to complete or a particular request to complete, you can try to add a web request plugin for a particular request that can validation the status of its previous request. If the status is passed, you let the particular request to execute. Or you can try to add some conditions for a request. If the condition is met, the particular request can be executed.

    Thanks,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us

  • 2012年8月20日 6:14
     
     

    Amanda,

    I understand this and i was working on this already. But can you please help with the code or the statement which waits for all responses or prev response to complete...

    I tried using the below one which is not working.

    e.Response.StatusCode

    Please help.

  • 2012年8月21日 10:04
    モデレータ
     
     回答済み

    Hi checkoutsree,

    You can insert a condition for a particular request to let it execute after the previous request completes.

    Right click a request and select Insert condition, then in the Add condition rule and items to condition pop-up window, you can select the Last Request Outcome or Last Response Code rule and set properties for the selected rule.

    I hope this will be helpful to you.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us