MarketSquare / robotframework-browser

Robot Framework Browser library powered by Playwright.
Apache License 2.0
497 stars 104 forks source link

When a keyword fails and presenter_mode is enabled the browser is not closed #3644

Open mardukbp opened 1 month ago

mardukbp commented 1 month ago

Describe the bug

When a keyword fails and presenter_mode is enabled the browser is not closed when the test finishes. The reason is that the keyword Record Selector is called when a keyword fails and presenter_mode is enabled.

To Reproduce

*** Settings ***
Library    Browser    enable_presenter_mode=True

*** Test Cases ***
Test
    New Browser    chromium    headless=False
    New Page       https://www.google.com
    Click          "Yahoo"

Expected behavior Browser library should honor the setting auto_closing_level and presenter_mode should behave according to the documentation: the tests run slower and each element acted upon is highlighted.

Desktop (please complete the following information):

Additional context If a user wants to execute Record Selector when a keyword fails, there are several options (which could be mentioned in the documentation): write a Listener, connect to a running Chromium-based browser that was started with --remote-debugging-port, use try-except. This error-handling should not be forced upon all users. presenter_mode is only meant to help the users see what Playwright does.

aaltat commented 1 month ago

Interesting, it should definitely close.

@allcontributors please add @mardukbp for bugs.

allcontributors[bot] commented 1 month ago

@aaltat

@mardukbp already contributed before to bug