robotframework-browser icon indicating copy to clipboard operation
robotframework-browser copied to clipboard

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

Open mardukbp opened this issue 1 year ago • 2 comments

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):

  • OS: Windows 10
  • Browser: Chromium installed by rfbrowser init chromium
  • Version: 18.5.1

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.

mardukbp avatar Jun 10 '24 18:06 mardukbp

Interesting, it should definitely close.

@allcontributors please add @mardukbp for bugs.

aaltat avatar Jun 10 '24 18:06 aaltat

@aaltat

@mardukbp already contributed before to bug

allcontributors[bot] avatar Jun 10 '24 18:06 allcontributors[bot]