Skip to main content

Capture Desktop Element

Command description

Captures a screenshot of the specified element and saves it to a file. The element's window is automatically brought to the front.

Command Input Parameters

Input parameterInput parameter typeDescription
Desktop ElementWinElement or str (captured element UID, not element name, not ms-rpa-id)Element to capture. Select a captured element or use Get Desktop Element, Get Similar Desktop Elements, or Get Related Desktop Elements.
FolderstrFull path of the folder in which to save the screenshot, for example C:\Screenshots
File Name OptionenumCustom File Name, Random File Name
File NamestrScreenshot file name. Required only when File Name Option is Custom File Name
Element Wait DurationnumberMaximum time to wait for the element to appear, in seconds. The command reports an error if the element does not appear in time.

Command Output Parameters

Output parametersOutput parameter typeDescription
Save PathstrFull path of the saved screenshot

Type definition reference

tip
  • This command automatically brings the window to the front and restores it if minimized, so Activate Window is normally unnecessary.
  • Capture element reference Capture Desktop Elements