webSocket

Opens a web socket connection to interact with the browser.

This method attaches to the default browser target, which creates a root session without session ID. The returned BrowserSession thus only provides a limited subset of the possible operations (only the ones applicable to the browser itself). Refer to the documentation of BrowserSession to see how to use it to attach to (and interact with) more specific targets.

Child sessions of returned BrowserSession use the same underlying web socket connection as the initial browser session returned here.

Note that the caller of this method is responsible for closing the web socket after use by calling BrowserSession.close, or using the auto-close capabilities via BrowserSession.use. Calling ChildSession.close or ChildSession.use on a derived session doesn't close the underlying web socket connection, to avoid undesirable interactions between child sessions.