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

Fix cannot find context error on Dispose #1291

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Conversation

ankur22
Copy link
Collaborator

@ankur22 ankur22 commented Apr 29, 2024

What?

This fixes an error when Dispose is called during a navigation from a page that contains an iframe.

Why?

Dispose can panic when a navigation occurs on a page with an iframe. The specific error that is returned is "Cannot find context with specified id". The reason for this error is due to the fact that Chrome has already cleaned up the associated resource before it receives the CDP command to release it. Therefore it is safe to handle this error, log a debug log and carry on with the test.

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

Updates: #1144

@ankur22 ankur22 requested a review from inancgumus April 29, 2024 15:37
Dispose can panic when a navigation occurs on a page with an iframe.
The specific error that is returned is "Cannot find context with
specified id". The reason for this error is due to the fact that Chrome
has already cleaned up the associated resource before it receives the
CDP command to release it. Therefore it is safe to handle this error,
log a debug log and carry on with the test.
@ankur22 ankur22 force-pushed the fix/dispose-cannot-find-ctx branch from 72239a3 to 7e42ae9 Compare April 29, 2024 15:38
@ankur22 ankur22 merged commit 8fc2666 into main Apr 30, 2024
17 checks passed
@ankur22 ankur22 deleted the fix/dispose-cannot-find-ctx branch April 30, 2024 13:35
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.

2 participants