File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
javascript/node/selenium-webdriver/lib Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -792,6 +792,10 @@ class WebDriver {
792792 if ( this . _wsConnection !== undefined ) {
793793 this . _wsConnection . close ( )
794794 }
795+
796+ if ( this . _bidi !== undefined ) {
797+ this . _bidi . close ( )
798+ }
795799 } )
796800 }
797801
@@ -1288,9 +1292,12 @@ class WebDriver {
12881292 * @returns {BIDI }
12891293 */
12901294 async getBidi ( ) {
1291- const caps = await this . getCapabilities ( )
1295+ if ( this . _bidi === undefined ) {
1296+ const caps = await this . getCapabilities ( )
12921297 let WebSocketUrl = caps [ 'map_' ] . get ( 'webSocketUrl' )
1293- 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 ;
12941301 }
12951302
12961303 /**
You can’t perform that action at this time.
0 commit comments