Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak when CDP connection is reset. #3994

Merged
merged 4 commits into from
Jan 24, 2024

Conversation

garg3133
Copy link
Member

The CDP connections are currently reset after a session has finished, but this doesn't always work, like in the case of Selenium, which has its own implementation of this.transport.sessionFinished and hence cdp.resetConnection() is never called.

So, instead of resetting the CDP connection after a session has finished, this PR moves that function call to when a new session is created, which is much more reliable, as whenever we get a new browser session, that's when we'd need a new CDP connection for that session.

Also, even in a single browser session, calling .registerBasicAuth() requires a new CDP connection to be created every time, otherwise the basic auth credentials are never registered. This PR fixes that as well.

Fixes: #3990.

Copy link

Status

  • ❌ No modified files found in the types directory.
    Please make sure to include types for any changes you have made. Thank you!.

@garg3133 garg3133 marked this pull request as draft January 17, 2024 14:29
@garg3133 garg3133 marked this pull request as ready for review January 17, 2024 16:50
@beatfactor beatfactor merged commit 5670d57 into nightwatchjs:main Jan 24, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CDP connection not getting reset across session when using Selenium.
2 participants