Can not Handle two consecutives alerts

Hi, All my test that has double alerts are failing/unstables on jenkins. Locally they are working.

We are using robotframework == 4.1.1 , robotframework-browser == 8.0.2

The problem i think is that the promise of the second alert is being set up late and the alert is already visible in the UI.

The first alert is this one and is being handle by this keyword:

Confirm Operation With Dialog
[Arguments] ${action} ${text} ${button_path}
${promise}= Promise To Wait For Alert action=${action} text=${text}
Click xpath=${button_path}
${alert}= Wait For ${promise}

and is being handle by this keyword:
Alert Message Should Be
[Arguments] ${action} ${text}
${promise}= Promise To Wait For Alert action=${action} text=${text}
${alert}= Wait For ${promise}

but for me the reason is failing is that the promise is settled after the alert is visible.

The error from jenkins:

###Error Message

Keyword ‘Alert Message Should Be’ failed after retrying 2 times. The last error was: TimeoutError: page.waitForEvent: Timeout 20000ms exceeded while waiting for event “dialog” =========================== logs =========================== waiting for event “dialog” ============================================================

The possible solution that I tried is to set 2 promise before the first alert is triggered like this:

${promise}= Promise To Wait For Alert action=accept text=Approve request for [068556] 68556, TEST?
${promise2}= Promise To Wait For Alert action=accept text=Request Hours exceed available hours. [20.00]
Click xpath=${button_path}
${alert}= Wait For ${promise}
${alert2}= Wait For ${promise2}

but this doesn’t works because is taking the first promise text when should be the second promise

Failing LOG:
${alert2} = Browser . Wait For ${promise2}
FAIL Alert text was: “Approve request for [068556] 68556, TEST?” but it should have been: “Request Hours exceed available hours. [20.00]”

Is like can’t create to promise at once then use one continues and use the second one

If someone can help with this :slight_smile:

Thanks

This could true, but first update to the latest Browser library release. If you still able to reproduce the problem, please raise an issue, event better if the issue has an example which we all can run.