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

[BUG] Request payload always null #23496

Closed
1 task done
paradox37 opened this issue Jun 3, 2023 · 2 comments
Closed
1 task done

[BUG] Request payload always null #23496

paradox37 opened this issue Jun 3, 2023 · 2 comments

Comments

@paradox37
Copy link

paradox37 commented Jun 3, 2023

System info

  • Playwright Version: [v1.34.3]
  • Operating System: [macOS 13.2.1]
  • Browser: [Chromium, Firefox]
  • Other info:

Source code

  • I provided exact source code that allows reproducing the issue locally.
import { test } from '@playwright/test';

test.describe('verify', async () => {
  test('test Case Name', async ({ page }) => {
    page.on('request', (request) => {
      if (request.method() === 'POST') {
        console.log(request.method());
        console.log(request.url());
        console.log(request.postData());
        console.log(request.postDataJSON());
        console.log(request.postDataBuffer());
      }
    });
    await page.goto('https://google.com');
    const inputs = await page.locator('[type="submit"]').all();
    await inputs[3].click();
  });
});

Steps

  • [Run the test]

Expected
postData to return payload
postDataJSON to return payload
postDataBuffer to return payload

Actual
returns null

The test above returns null for postDataJSON() and for postDataBuffer() and for postData(). I also tried using page.WaitForRequest() to get the payload, but the same result, null instead of payload. I tried both Chromium and Firefox.

@paradox37 paradox37 changed the title [BUG] [BUG] Request payload always null Jun 3, 2023
@mxschmitt
Copy link
Member

Looks like #6479

@paradox37
Copy link
Author

Yeah, it is, just found it after posting here. I am using RTK Toolkit in my project which is using request.clone(), and Chromium still didn't fix that issue.

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

No branches or pull requests

2 participants