We're updating the issue view to help you get more done. 

Closing a webtesting browser session without a parent context throws an error


Currently, a window needs a parent in the sense that it was opened by another window. Windows are closed using javascript, which prohibits closing windows that were not opened by scripts (Scripts may close only the windows that were opened by it.).

The window can be closed using Selenium (((IWebDriver) context.Browser.Driver.Native).Close()). This "breaks" the underlying Coypu.BrowserSession in WebTestHelper.MainBrowserSession, which needs to be replaced by a new instance representing the new root window.

A new API could be added, allowing to change the root browser window. When closing a browser window, a guard should check if it is the root window and if so, throw an understandable exception.

It is possible in Remotion.Web.Development to create a new BrowserSession without a parent context, but when trying to close this browser session an error is thrown that no parent context is available.

A parent context should not be required for creating and closing browser sessions.

The method Remotion.Web.Development.WebTesting.CoypuBrowserWindowExtensions.CloseWindow should not check whether a parent context has been provided.

Adding the following test to MultiWindowTest reproduces this issue:


Marcel Holle


Bernhard Schuller



Time tracking

6h 30m


Fix versions

Affects versions