Properly using Wait for Response

Hello Guys my first post here,

Basically I have the following situation, I need to automate a website that has some buttons on click refresh the page and put new info on a table.
So, I need to do a Click and wait until the response of this action.

I know the “Wait for response” keyword, but I fell like I am not understanding it, basically can you guys explain to me the diference between this two codes:

Click ${button}
Wait for Response

And

${promise} =    Promise To    Wait For Response
Click    ${button}
Wait For    ${promise}

What is the most correct? (if there is one)

1 Like

There is a possibility that the click related request response happens before you attach the wait if wait is done after. So with the Promise To is more correct.

Got it, but when I only use like this, seems like the promise don’t take the right response, because the “Wait for” simply pass and don’t wait the response of the button.
Any tip? How to catch the right response for this case?

You need to restrict the requests with the url they are calling https://marketsquare.github.io/robotframework-browser/Browser.html#Wait%20For%20Response

I would check from developer console network tab in the browser what traffic there is and choose the correct package url.

1 Like