Skip to content

[BUG] setInputFiles does fetch that fails due to CSP #632

@sadiqueimam

Description

@sadiqueimam

Hi, I am trying to upload a file but getting below error:
Error: Evaluation failed: TypeError: Failed to fetch
at playwright_evaluation_script:3:30
at Array.map ()
at playwright_evaluation_script:2:46
at CRExecutionContext.evaluate

Code:
const drop= await page.waitForSelector("//input[@type='file']");
await drop.setInputFiles('pic.png')

Also, the same was working with below Puppeteer code:
const drop= await page.waitForXPath("//slot/input[@type='file']");
await drop.uploadFile('pic.png');

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions