Skip to main content

Upload File on Webpage

Command description

Set file paths on a web file-input element through the browser API without opening a file-picker dialog.

Command Input Parameters

input parametersInput parameter typeDescription
Webpage ObjectWebPageUpload files on this page
Web ElementWebElement or str (captured element UID, not element name, not ms-rpa-id)File-input element; select a captured element or one returned by Get Web Element, Get Similar Web Elements, or Get Related Web Elements
File Liststr or list[str]One absolute local file path or a list of absolute paths
Element Wait DurationnumberMaximum time to wait for the element to appear, in seconds

Command Output Parameters

None

Type definition reference

tip

The element must be <input type="file">.

Each file path must be absolute, for example C:\files\report.pdf.

The command accepts one or multiple files. In Python mode, provide a str or list[str]. Otherwise, enter one file path per line.

  • Python list[str] method to upload two files

  • Python str method to upload a file

  • Upload two files in non-Python mode

Note

On the browser's extensions page, open the Runavelo extension details and enable Allow access to file URLs. Then refresh the webpage before uploading.

Some sites, including QQ Mail and Zhihu, hide their <input type="file"> element so it cannot be captured directly. Capture a related element, then edit it by adding an INPUT node with the attribute type=file.

tip
  • Runavelo browser extension 2.4.0 or later
  • Runavelo 7.7.0 or later

FAQ

See Web Automation FAQ