How To Upload Files Using Playwright | Playwright - Part 6

preview_player
Показать описание
Uploading file is never been easy in any framework buy playwright is awesome and it makes our life easier.
In this video, I've explained how to upload single or multiple files using Playwright.

0:00 How to upload files using playwright
0:50 upload sing file
6:30 upload multiple files
7:50 upload using file chooser listener
14:00 Recap

Source code:

#playwright​ #letcode

Join this channel to get access to perks:
Рекомендации по теме
Комментарии
Автор

Hi Koushik, thanks for making videos...Just wanted to know when should we trigger the below lines in case of file upload tests:
await page.close();
await context.close();
await browser.close();

Because if we do it at the end of the test...the test finishes before the file is uploaded due to which the test fails..Please tell the place where these lines of code should be used?
Thanks

lakshbhutani
Автор

Thanks for all your videos and guidance they are beneficial :)
Is there a way how to compare 2 files? I am downloading a file using the playwright waitForEvent after that I am storing the file in some path and I am looking for a solution on how to compare this file to a different "base" file or a different file that I am going to download from another location in my project

moriyamegidish
Автор

Your video helped me - I was stuck in the dispatchevent method for a while to accomplish the same task

arunpahilajani
Автор

Hi Koushik, can you please create a tutorial on downloading a file with playwright. Thanks for creating playwright playlist for everyone, your tutorials are concise right to the point. Will eagerly look forward to have this tutorial on your playwright playlist.

sridevilanka
Автор

Hi Koushik, quick question, I would like to upload a file in an API test, It is just a POST where I need to upload a file in order to get an uid of it as a response. How can I do it?

guillermopodesta
Автор

Thanks you very much! I code in Python, anyway I'd undestand and you help me to resolve my code

nelsonivantontarelli
Автор

Hi, find all session very informative and interesting. will you plz add a video regarding cucumber/gherkin integration with playwright?

NikhilThakare-zy
Автор

Good job! thanks for this helpful tutorial. I just want to ask if you have an idea on how to this(uploading multiple files) using sendkeys.

johnsanchez
Автор

Bonjour,
awesome bro, I love it ;)
Thanks

dragon
Автор

Is it possible to add these file path into tsconfig.json rather than keeping it on the test file?

johncyvarghese
Автор

Hi Koushik,

if method return type is bool,
How to store in variable?/
I have used like
let status:boolean;
status=page.Getstatus();

I getting error 'Type 'boolean' is not assignable to type 'false'
Please help me on this

rameshpadi
Автор

How do I perform this with a file not on my local machine? Let say I have a file on a network drive, how do I upload that file using playwright?

steveulysse
Автор

U used prefix 'x' for the some of the tests. which means?

visonabletest
Автор

Hi, This is great, and works fine locally on my laptop. However if I try and run on the CI tool we are using - GH Actions, the file does not upload? Any ideas?

RyanRedpath-tu
Автор

Hi Koushik, while uploading the file i am getting this error "Error: ENOENT: no such file or directory, stat 'filePath', however The files I need to upload are in that folder( lives in this directory)the playwright folder is where the rest of the project lives as well Im running the tests by typing npx playwright test

nitityagi
Автор

Do you have a complete course on udemy?? or somewhere else .. if yes, please share the link

aakashsingh
Автор

Hi Sir
It's very informative and thank you very much for guidance. can you please throw some light on playwright with folio And page object model or automation framework using it.

VishalDeshpande
Автор

I tried replicating the same code but am getting "fileChooser.setFiles: Target closed". How can we resolve this error?

bhavindesai
Автор

can we upload folder using filechooser?

pankajsingh
Автор

Could u pls explain file upload using page object model in playwright

yuvaraj