Skip to content

File inputs

Interactions with input with attribute type="file".

Reading the element

Getting the right element class for the xpath

my_input = web.element('//*[id="myFileInput"]')
type(my_input)
Output
fastrpa.core.elements.FileInputElement

Try to get a FileInputElement

my_input = web.file_input('//*[id="myFileInput"]')
type(my_input)
Output
fastrpa.core.elements.FileInputElement

Reference

Attach a local file

my_input.attach_file('/home/user/picture.png')

Attach a file from the web

my_input.attach_file('https://website.com/picture.png')