Can not Handle two consecutives alerts

Hello, I noticed same issue long time ago and I was willing that it will be resolved within next Browser releases but it still occurs.

ENV:

Win 11 E
Python 3.11.9
NodeJS v20.15.1
Browser library 18.6.3
Robot Framework version: 7.0.1
Playwright 1.45.0

I’ve created simple html page with two alerts and simple RFB script where you can easily debug this issue. Manually alerts are visible and interactive. RFB scripts fails as its not able to handle multiple alerts. Please check below example manually vs via script.

index.html





Multiple alerts issue - example


Click to show alerts

    <script>
        function showAlerts() {
            confirm("First alert accepted?");
            alert("Second alert!");
        }
    </script>
</body>
</html>

example.robot
*** Settings ***
Library Browser

*** Test Cases ***
Alert-Debug
    Browser Setup
    #provide correct index.html path below
    Go To    C:/alert_demo/index.html
    Click    //button
    Validate Alert Response    First alert accepted?
    Validate Alert Response    Second alert!

*** Keywords ***
Browser Setup
    Set Browser Timeout    30
    New Browser     browser=chromium     headless=false    args=["--start-maximized"]
    New Context    viewport=${None}
    New Page        url=about:blank

Validate Alert Response
    [Arguments]     ${messageValue}
    ${message} =    Wait For Alert    action=accept    text=${messageValue}    timeout=5

Actual failure message:

TimeoutError: page.waitForEvent: Timeout 5000ms exceeded while waiting for event “dialog”
=========================== logs ===========================
waiting for event “dialog”

Tip: Use “Set Browser Timeout” for increasing the timeout.