I'd expect that when i call Close Second Browser which uses its own variables, only the second browser would be closed and first one should still remain. However, once Close Browser ${second_browser} is called, all browser instances from gone from the ui and Get Browser Catalog is empty list ..
*** Settings ***
Library Browser
*** Test Cases ***
Reproduce Close Browser Bug
Open First Browser
Open Second Browser
Print Browser Catalog FIRST: OPEN - SECOND: OPEN
Close Second Browser
Print Browser Catalog FIRST: OPEN - SECOND: CLOSED # catalog is empty at this point
Close First Browser # and this fails because of ^
Print Browser Catalog FIRST: CLOSE - SECOND: CLOSED
*** Keywords ***
Open First Browser
VAR &{viewport_args} width=800 height=600
${first_browser}= New Browser chromium headless=False
Set Global Variable ${first_browser}
${first_context}= New Context viewport=${viewport_args}
Set Global Variable ${first_context}
${first_page}= New Page https://www.google.com
Set Global Variable ${first_page}
Close First Browser
Close Page ${first_page}[page_id]
Close Context ${first_context}
Close Browser ${first_browser}
Open Second Browser
VAR &{viewport_args} width=800 height=600
${second_browser}= New Browser chromium headless=False
Set Global Variable ${second_browser}
${second_context}= New Context viewport=${viewport_args}
Set Global Variable ${second_context}
${second_page}= New Page https://bing.com
Set Global Variable ${second_page}
Close Second Browser
Close Page ${second_page}[page_id]
Close Context ${second_context}
Close Browser ${second_browser}
Print Browser Catalog
[Arguments] ${prefix}
${ctl}= Get Browser Catalog
Log To Console \n\n${prefix}: ${ctl}\n
Switch to "first browser" before closing the second one does not help either, both browsers are closed..
Mm.. Nevermind, reuse_existing to False .. I was thrown off by the browser id being different for first and second browser instance but apparently they where still the same process..
Here's a a script to reproduce the issue.
I'd expect that when i call
Close Second Browser
which uses its own variables, only the second browser would be closed and first one should still remain. However, onceClose Browser ${second_browser}
is called, all browser instances from gone from the ui andGet Browser Catalog
is empty list ..Switch to "first browser" before closing the second one does not help either, both browsers are closed..