Forum Discussion

mgroen2's avatar
mgroen2
Super Contributor
7 years ago

How to implement some sort of "wait for" a response

Hi,

The scenario is as follows:

I need to implement a waiting time, until a certain response is received.

Now, there is a "Delay" function available, but this delaying the test with a fixed value.

 

 

I need something that delays the script (wait for), until a response is received.

 

Is there an approach available, which can realize that?

 

 

 

 

2 Replies

  • Hi Mathijs,

     

    If this response is a result of an HTTP request? If so, LoadComplete will not simulate further requests before getting the response in either of the following situations:

    1. Further requests live in the same connection.
    2. Further requests live in next page.

    I think that you can make use of second option – create a separate page and extract the needed request/response pair to this new page. LoadComplete won’t simulate traffic for next page until the response is received.

     

    Please let me know if this doesn’t work for you.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Mathijs,

     

    It is my understanding (as per https://support.smartbear.com/viewarticle/78786/) that LoadComplete does not wait for the response only in case of WebSocket protocol. Is this your case?

    Otherwise, for the http(s) protocol LoadComplete always waits for the response to check the response code and thus to assert if the sent request succeeded.
    Can you provide more details what does not work in your case ?