new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Playwright · API reference · all subjects

filechooser

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

FileChooser class

FileChooser objects are dispatched by the page in the Page.fileChooser event. FileChooser was added in v1.8.

FileChooser.setFiles example with waiting

To wait for a file chooser and set files in JavaScript: const fileChooserPromise = page.waitForEvent('filechooser'); await page.getByText('Upload file').click(); const fileChooser = await fileChooserPromise; await fileChooser.setFiles(path.join(__dirname, 'myfile.pdf'));

FileChooser.setFiles example Java

To wait for a file chooser and set files in Java: FileChooser fileChooser = page.waitForFileChooser(() -> page.getByText("Upload file").click()); fileChooser.setFiles(Paths.get("myfile.pdf"));

FileChooser.setFiles example Python sync

To wait for a file chooser and set files in Python sync: with page.expect_file_chooser() as fc_info: page.get_by_text("Upload file").click() file_chooser = fc_info.value; file_chooser.set_files("myfile.pdf")

FileChooser.setFiles example C#

To wait for a file chooser and set files in C#: var fileChooser = await page.RunAndWaitForFileChooserAsync(async () => { await page.GetByText("Upload file").ClickAsync(); }); await fileChooser.SetFilesAsync("temp.txt");

Give your agent this brain