class Playwright::FileChooser
`FileChooser` objects are dispatched by the page in the [`event: Page.fileChooser`] event.
“`python sync with page.expect_file_chooser() as fc_info:
page.click("upload")
file_chooser = fc_info.value file_chooser.set_files(“myfile.pdf”) “`
Public Instance Methods
element()
click to toggle source
Returns input element associated with this file chooser.
# File lib/playwright_api/file_chooser.rb, line 13 def element wrap_impl(@impl.element) end
multiple?()
click to toggle source
Returns whether this file chooser accepts multiple files.
# File lib/playwright_api/file_chooser.rb, line 18 def multiple? wrap_impl(@impl.multiple?) end
page()
click to toggle source
Returns page this file chooser belongs to.
# File lib/playwright_api/file_chooser.rb, line 23 def page wrap_impl(@impl.page) end
set_files(files, noWaitAfter: nil, timeout: nil)
click to toggle source
Sets 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 the current working directory. For empty array, clears the selected files.
# File lib/playwright_api/file_chooser.rb, line 29 def set_files(files, noWaitAfter: nil, timeout: nil) wrap_impl(@impl.set_files(unwrap_impl(files), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout))) end
Also aliased as: files=