[BUG] File not uploaded via the setInputFiles() function
See original GitHub issueContext:
- Playwright Version: 1.16.3
- Operating System: Windows
- Node.js version: 14.6
- Browser: Chrome
- Extra: [any specific details about your environment]
Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:
await this.page.setInputFiles(this.fileNameTextFieldLocator, resourceFileToUpload);
Describe the bug
I’m trying to upload the file via page.setInputFiles() function.
The locator is the following:
It is an input element. But the function doesn’t work for me.
P.S. Maybe it is related to the fact that the input field is defined as a readonly?
P.S.2 The icon is not defined as input - can it be used in some way in the function? According to documentation - the function setInputFiles() can be used only with input elements.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Playwright: Upload files from non-input element that cannot be ...
To upload a file using Playwright use setInputFiles(selector, files[, options]) function. This method takes the selector of the input ...
Read more >How to Upload File in Playwright - YouTube
In Playwright, you can use the setInputFiles() method to upload files, if the element type is input. For non-input element types or when...
Read more >Using files from web applications - Web APIs - MDN Web Docs
The FileUpload function accepts two inputs: an image element and a file from which to read the image data. ... The FileUpload() function...
Read more >MBS FileMaker Plugin: CURL.SetInputFile
SetOptionUpload to make it an upload for FTP/SFTP. Using this function is not recommended for more than a 1 GB of data. If...
Read more >How to Upload File in Playwright - ProgramsBuzz
In Playwright, you can use the setInputFiles() method to upload files, if the element ... Multiple files are specified using the array[].
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Your input should be of type=“file”, it should be somewhere in the DOM. This is how it’s in my application.
@pavelfeldman It’s just a selector that founded in the DOM. We use the pattern: textFieldLocator - just stores a selector in the DOM. textFieldElement - element it self (of any type).