Skip to content

[Regression]: Request body is not correct when copying request #38590

@cpAdm

Description

@cpAdm

Last Good Version

1.56

First Bad Version

1.57

Steps to reproduce

  1. Open UI mode
  2. Run following test
import { test, request, expect } from '@playwright/test';


test('fetch call to example site with payload', async ({}) => {
    const ctx = await request.newContext();
    const res = await ctx.post('https://httpbin.org/post', {
        data: {message: 'Hello from Playwright!', number: 123},
        headers: {'Content-Type': 'application/json'},
    });
    await expect(res).toBeOK();
    await ctx.dispose();
});
  1. Open network tab
  2. Select post request
  3. Click copy request (e.g. as fetch)

Expected behavior

Expected body:
"body": "{\"message\":\"Hello from Playwright!\",\"number\":123}",

Actual behavior

Body:
"body": "{\"error\":\"trace parameter is missing\"}",

Additional context

(also tested with changes from #38566, still an issue)

Environment

System:
    OS: Linux 6.6 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
    CPU: (12) x64 Intel(R) Core(TM) i5-10505 CPU @ 3.20GHz
    Memory: 5.41 GB / 19.53 GB
    Container: Yes
  Binaries:
    Node: 22.15.1 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.9.2 - /usr/bin/npm
  Languages:
    Bash: 5.2.21 - /usr/bin/bash

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions