English · .NET
Appearance
English · .NET
Appearance
FileChooser objects are dispatched by the page in the Page.FileChooser event.
var fileChooser = await page.RunAndWaitForFileChooserAsync(async () =>
{
await page.GetByText("Upload file").ClickAsync();
});
await fileChooser.SetFilesAsync("temp.txt");Returns input element associated with this file chooser.
Returns
ElementHandleReturns whether this file chooser accepts multiple files.
Returns
booleanReturns page this file chooser belongs to.
Returns
PageSets the value of the file input this chooser is associated with. If some of the filePaths are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.
Arguments
files path | Array<path> | Object | Array<Object>
name string
File name
mimeType string
File type
buffer Buffer
File content
noWaitAfter boolean (optional)
This option has no effect.
Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 to disable timeout. The default value can be changed by using the BrowserContext.SetDefaultTimeout() or Page.SetDefaultTimeout() methods.