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

Implement page.on('requestfailed') #4299

Open
ankur22 opened this issue Jan 30, 2025 · 0 comments
Open

Implement page.on('requestfailed') #4299

ankur22 opened this issue Jan 30, 2025 · 0 comments

Comments

@ankur22
Copy link
Contributor

ankur22 commented Jan 30, 2025

Feature Description

page.on('requestfailed') should be called when the request fails to be sent to the website under test (WuT). So not when k6 browser receives 404/500 back from the server (which is regarded as a success and will be directed to page.on('requestfinished')).

When implementing page.on('request') and page.on('response') it became apparent that some of the methods on the request and response objects didn't behave the same as in Playwright. However, to overcome the shortfalls (1, 2) in page.on('request') a user should work with page.on('response') and to overcome the shortfall in that, we should implement both page.on('requestfailed') and page.on('requestfinished').

Suggested Solution (optional)

The implementation should be fairly trivial and these two PRs should help with the implementation:

  1. Add page.on('request') #4290
  2. Add page.on('response') #4296

The call to the handle should be done from onLoadingFailed.

Already existing or connected issues / PRs (optional)

Connected to: #4234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants