Skip to main content

Attach File

Selects a file from the user's local machine to be attached to an HTML form for submission.

Category: Web Element Interaction · Group: Web · Activity name: AttachFile

The AttachFile activity in the designer

Example

AttachFile("<selector>", "<filePath>", iframeSelector="<iframeSelector>", iframeSelectors=[])

Inputs

NameTypeRequiredDefaultDescription
SelectorstringYesCSS selector or XPath to identify the input control.
iFrame SelectorstringCSS selector or XPath to locate the iframe containing the target element. Leave empty if the element is not inside an iframe.
iFrame SelectorsarrayAn ordered array of CSS selectors or XPaths to locate nested iframes containing the target element. Provide selectors in order from outermost to innermost iframe (e.g., ['#parent-frame', '.child-frame'] for an element inside a child iframe that's within a parent iframe). Leave empty if the element is not inside any iframes.
FilePathstringYesLocal path of the file