question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] 1.12.0 does not capture Page onRequest or onResponse

See original GitHub issue

It seems like onRequest/onResponse are broken in 1.12.0. This example illustrates the problem:

public class OnRequestResponseTest {

	public static void main(String[] args) {
		try (Playwright playwright = Playwright.create()) {
			try (Browser browser = playwright.chromium().launch()) {
				BrowserContext context = browser.newContext();
				Page page = context.newPage();
				page.onRequest(r -> {
					System.out.println("request: " + r);
				});
				page.onResponse(r -> {
					System.out.println("response: " + r);
				});
				page.navigate("https://example.com/");
				System.out.println(page.title());
			}
		}
	}
}

Output 1.11.0:

request: https://example.com/
response: https://example.com/
Example Domain

Output 1.12.0

Example Domain

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
regbocommented, Jun 11, 2021

Odd, it works just fine when I run it on a clean projec.t Sorry to waste your time. Must have something screwy in my setup.

0reactions
yury-scommented, Jun 11, 2021

Another note, it DOES NOT work in 1.12.0 via browser or page when using connect instead of launch.

Make sure that the Playwright server version you connect to matches that of the client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mocking API errors doesn't work in 1.20.0 · Issue #7213 - GitHub
The request should be mocked and no error thrown. This used to work in 1.19.0. What is your public website URL? (or attach...
Read more >
Chrome extension API webRequest doesn't work well on ...
So I'm trying the Chrome API webRequest. Everything works fine on request, but on response, I got problems. My testing is pretty straight ......
Read more >
Changelog - Proxyman
Bugs. Fixed: Reverse Proxy Window Theme is incorrect if the Proxyman theme ... [UI/UX] Helper Tool Recommendation if the app does not capture...
Read more >
Changelog - hapi.dev
Preserve original response status on error after write, fix status message. #4182. server.inject does not reflect actual HTTP response in case of stream ......
Read more >
azure-core - PyPI
An error response with status code 4xx. This will not be raised directly by the Azure core pipeline. TooManyRedirectsError. An error raised when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found