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
[🐛 Bug]: Network Interception doesn't work in JavaScript example. #10004
Comments
@yaoyao0821, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
After troubleshooting the issue, please add the Thank you! |
Hi there, is there any updates on this issue? Is is a bug or did I miss anything? Thank you and best, |
Hi @yaoyao0821 , Thanks for raising the issue. I'll look into this! |
Any update on this fix? Thank you. |
The current implementation couldn't really work it intended to. If you check the sourcecode, the Fetch.continueRequest is actually manipulating the request instead of the response:
For manipulating the response, we may need to use Fetch.fulfillRequest
And also in the callback, I suggest to pass callback(requestPausedParams) so that would help us to capture basic XHR info and do assertions in the tests |
@zzhengjian would you like to send us a PR to improve this? |
Hi @yaoyao0821 , This is fixed with commit 85a7856 and the fix is available in the latest Could you please check again and let us know about this? Thanks, |
Closing as it is resolved in 4.3.0! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What happened?
Hi there, I try the Network interception JavaScript example but it fails to intercept the response.
The first Collect Performance Metrics example works good, but the second onIntercept function example doesn't work.
After sending the request (await driver.url()), the page still returns the original response and nothing is changed.
Note: The first line of the example maybe wrong. It causes an error because of the lack of argument in createCDPConnection function in the example code. I check the source code and add an argument ‘page’ to fix it. Now there is no errors but still interception doesn’t work and always returns a 404 error.
Is it a bug in JavaScript or do I miss anything? Thanks!
How can we reproduce the issue?
Relevant log output
Operating System
macOS BigSur 11.2.3
Selenium version
JavaScript 4.0.0
What are the browser(s) and version(s) where you see this issue?
Chrome 95.0.4638.69
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 95.0.4638.54
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: