I’m having problem with closing the context where browser tab was auto-closed.
The scenario that I need to perform is:
New context
Open browser
Open new tab (automatically open after click on button)
Close tab (automatically closed after saved changes)
Close context
I can not properly close the context because I’m having following error: Error: page.bringToFront: Target page, context or browser has been closed.
It looks like it stores somewhere in memory already auto-closed tab.
I’m using Chromium 102.0.5005.40
Extra info to my post.
When I do Get Page Ids I still have that auto-closed page id there and CURRENT page is considered as the one that was just closed.
Thanks Dave. I’am using Browser Library and already tried with solution proposed by you.
I can switch to the main page by it’s id but still can not close the context.
When I do Get Page Ids it returns two ids - for the main page and for the one that was already automatically closed.
Is it the Close Context step in your Suite Teardown that’s causing you the issue? (perhaps I misunderstood the problem)
Have you tried with Close Context ALL
I’m not sure you even need to close the context in the teardown, simply closing the browser with Close Browser will close the contexts as well, as that’s Suite Teardown, you’re not going to be doing anything else with the browser, so no reason to close the context and keep the browser open?
Yes, exactly - Close Context causing the issue.
I didn’t paste the wole code as I thougt it might be just Chromium issue.
At the same time I have another context open so I believe I can not use Close Context ALL.
Here is the whole Suite Setup and Suite Teardown: