Skip to content

Commit

Permalink
[js] Close CDP websocket connection on driver.quit (#14501)
Browse files Browse the repository at this point in the history
  • Loading branch information
pujagani authored Sep 16, 2024
1 parent a7a53fb commit 7c8b46d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions javascript/node/selenium-webdriver/lib/webdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,14 @@ class WebDriver {
if (this.onQuit_) {
return this.onQuit_.call(void 0)
}

// Close the websocket connection on quit
// If the websocket connection is not closed,
// and we are running CDP sessions against the Selenium Grid,
// the node process never exits since the websocket connection is open until the Grid is shutdown.
if (this._wsConnection !== undefined) {
this._wsConnection.close()
}
})
}

Expand Down

0 comments on commit 7c8b46d

Please sign in to comment.