You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to automate a video upload in a DSP platform using Playwright. When I upload the video manually via the UI, everything works — the video preview is shown and I can proceed. But when I try to upload it using setInputFiles, the test passes but the video never appears, and it seems like the upload doesn't actually go through (even though there's no error).
The text was updated successfully, but these errors were encountered:
Sangamesh-m007
changed the title
Video Upload Succeeds via Manual UI, but Fails Silently via Playwright's setInputFiles
(Question)Video Upload Succeeds via Manual UI, but Fails Silently via Playwright's setInputFiles
May 7, 2025
The problem is that you are uploading videos with proprietary codecs and Chromium does not support mp4 with all the codecs. In the code itself, there is something like this:
there is on onerror handler tho which would yell if the video can't load, e.g. due to unsupported codecs.
I recommend reaching out to your developers to add such a handler and add appropriate error reporting.
To fix the tests, you can use channel: 'chrome' in your playwright.config.ts's use section. I also used Codegen to create a bit of a more reliable version of your test which follow our best-practises:
import{test,expect}from'@playwright/test';test('File Upload Test',async({ page })=>{awaitpage.goto('https://qa.alkimi-dsp.com/user/login');awaitpage.getByRole('textbox',{name: 'Login'}).fill('admin@alkimi.org');awaitpage.getByRole('textbox',{name: 'Password'}).fill('AlkimiPassw0rd!');awaitpage.getByRole('button',{name: 'Log In'}).click();awaitpage.getByRole('button',{name: 'Creatives'}).click();awaitpage.getByRole('menuitem',{name: 'Creatives'}).click();awaitpage.getByRole('link',{name: 'New Creative'}).click();awaitpage.getByRole('button',{name: 'Select advertiser Select'}).click();awaitpage.getByText('Advertiser-').click();awaitpage.getByRole('button',{name: 'Creative details'}).click();awaitpage.getByRole('textbox',{name: 'name'}).fill('Tester123');awaitpage.locator('[id="Date\\ From"]').fill('2025-05-22');awaitpage.getByRole('group').filter({hasText: 'Date To*'}).getByRole('textbox').fill('2025-05-23');awaitpage.getByRole('textbox',{name: 'landingUrl'}).fill('https://www.alkimi.org');awaitpage.getByRole('button',{name: 'Dimensions Dimensions *'}).click();awaitpage.getByText('1280x720').click();awaitpage.getByText('Select a file or drop hereMP4, WEBM or OGG, file size no more than 10MBSelect').click();constwaitForFileChooser=page.waitForEvent('filechooser');awaitpage.getByText('Select File').click();constfileChooser=awaitwaitForFileChooser;awaitfileChooser.setFiles('output.mp4');awaitexpect(page.getByText('1280px x 720px')).toBeVisible();});
Hi
I'm trying to automate a video upload in a DSP platform using Playwright. When I upload the video manually via the UI, everything works — the video preview is shown and I can proceed. But when I try to upload it using setInputFiles, the test passes but the video never appears, and it seems like the upload doesn't actually go through (even though there's no error).
The text was updated successfully, but these errors were encountered: