We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 375e841 commit a37a727Copy full SHA for a37a727
1 file changed
javascript/node/selenium-webdriver/lib/webdriver.js
@@ -792,6 +792,10 @@ class WebDriver {
792
if (this._wsConnection !== undefined) {
793
this._wsConnection.close()
794
}
795
+
796
+ if (this._bidi !== undefined) {
797
+ this._bidi.close()
798
+ }
799
})
800
801
@@ -1288,9 +1292,12 @@ class WebDriver {
1288
1292
* @returns {BIDI}
1289
1293
*/
1290
1294
async getBidi() {
1291
- const caps = await this.getCapabilities()
1295
+ if (this._bidi === undefined) {
1296
+ const caps = await this.getCapabilities()
1297
let WebSocketUrl = caps['map_'].get('webSocketUrl')
- return new BIDI(WebSocketUrl.replace('localhost', '127.0.0.1'))
1298
+ this._bidi = new BIDI(WebSocketUrl.replace('localhost', '127.0.0.1'))
1299
1300
+ return this._bidi;
1301
1302
1303
/**
0 commit comments