Skip to content

Upload file on web element click

Description

Uploads a file by clicking a web element and selecting the input file path

Input Ports

Name dataType sourceType required description
Element selector text link-manual true The checkbox selector you want to check or uncheck.
iFrame selector text link-manual false If the element is inside of an Iframe, it is mandatory to specify the iframe selector, otherwise the element won’t be found.
iFrame type text manual-only false Option to add more iframes if the targeted element exists in a nested iframe
File path text link-manual true The path to the file that needs to be uploaded

Scenarios

  • The user wants to upload a file

Use case

It is required to make use of the Launch web browser command.

Command

Inputs
  • Element selector: body > h1
  • iFrame selector: #iframeResult
  • iFrame type: single
  • File path: D:/example.pdf
Experienced tips
  • When the Element selector does not exist, the command will timeout
  • When the iFrame selector does not exist, the command will timeout
  • When the File path are empty, the process will stop and provide you with the following error. fileChooser.setFiles: elementHandle.setInputFiles: Cannot read property 'name' of null
  • When the File path does not exist, the process will stop and provide you with the following error. fileChooser.setFiles: elementHandle.setInputFiles: ENOENT: no such file or directory, open
Search Tags

upload a file