Wait for Control to Enable

Verb: waitEnabled

It awaits a control to be enabled, using the Timeout parameter as a maximum wait time for execution. At the end, it returns whether it is enabled or not.

Controls are, on Windows, elements that allow the user to interact with an application. Controls may be buttons, data entry fields, menus and various other elements.

Syntax

waitEnabled --timeout(TimeSpan) --selector(ControlSelectors) --id(String) --name(String) --innertext(String) --tagname(String) --xpath(String) --classname(String) --elementvalue(String) --controltype(Nullable<ControlTypes>) --index(Numeric) --control(Control) [--usetable(Boolean)] [--searchbycolumn(Boolean)] --searchcolumn(String) --searchvalue(String) --returncolumn(String) --row(Numeric) (Boolean)=value

Inputs

Script Designer Required AcceptedTypes Description
--timeout Timeout Required Time Span, Number, Text Maximum wait time until the control is enabled.
If no value is defined in the parameter of type timeout, the execution uses the time defined by the Set Timeout command. If the script does not use this command, the default time is 5 seconds.
--selector Selector Required ControlSelectors Type of selector used to identify user interface controls. The following options are available:
  • Class and value
  • Class name
  • Id
  • Id and name
  • Inner text and control type
  • Instance
  • Name
  • Name and value
  • Type and index
  • Type and name
  • XPath

  • It is possible to use the IBM RPA Studio's recorder to map the controls and obtain the necessary information for the “Selector” parameters, in addition to inserting commands in the script with automatic filling of these parameters. The recorder is available in the upper toolbar on the platform.
    --id Id Only whenSelector is Id, IdAndName Text User interface control id.
    --name Name Only whenSelector is Name, NameAndValue, IdAndName, TypeAndName Text Name of the user interface control.
    --innertext Inner Text Only whenSelector is InnerTextAndTag Text Internal text of the user interface control.
    --tagname Tag Name Only whenSelector is InnerTextAndTag Text Type of the element or tag.
    --xpath XPath Only whenSelector is XPath Text XPath of the user interface control.
    --classname Class Only whenSelector is ClassAndValue, ClassName Text User interface control class.
    --elementvalue Element Value Only whenSelector is ClassAndValue, NameAndValue Text Current value of the user interface control.
    --controltype Type Only whenSelector is TypeAndIndex, TypeAndName ControlTypes Type of UI control. Options:
  • Button
  • Check box
  • Child window
  • Combo box
  • Generic
  • Image
  • Label
  • List box
  • Menu bar
  • Menu item
  • Progress bar
  • Radio button
  • Scroll bar
  • Slider
  • Spinner
  • Status bar
  • Tab page
  • Tab panel
  • Table
  • Text box
  • Toggle button
  • Tree view
  • TreeTable
  • Window
  • --index Index Only whenSelector is TypeAndIndex Number Index of the user interface control.
    --control Control Only whenSelector is Instance Control Control instance.
    This variable is obtained using the command Search Control.
    --usetable Element in Table Optional Boolean When enabled, searches for an element within the table.
    --searchbycolumn Search by Column Optional Boolean When enabled, searches for the element by the columns, not by rows.
    --searchcolumn Column Only whenElement in Table is True Text Name or number of the column to get the element from.
    --searchvalue Value Only whenSearch by Column is True Text Value used to find the element in the table.
    --returncolumn Return Column Only whenSearch by Column is True Text Column that contains the control.
    --row Row Only whenSearch by Column is False Number Table row from which the element is obtained.

    Outputs

    Script Designer AcceptedTypes Description
    value Enabled Boolean Returns "True", if the field is enabled, or "False", if not.

    Example

    This example opens MS Paint, waits until the control is enabled, using the Timeout parameter as the timeout value, and returns whether it is enabled or not.

    defVar --name paintWindow --type Window
    defVar --name waitEnabled --type Boolean
    launchWindow --executablepath "C:\\Windows\\system32\\mspaint.exe" paintWindow=value
    // Check if parameter is enabled
    waitEnabled --timeout 00:00:40 --selector "Name" --name View waitEnabled=value
    logMessage --message "View parameter is enabled in the current execution context: ${waitEnabled}" --type "Info"
    closeWindow --window ${paintWindow}
    // The return varies according to the current execution context. In the case of this example: True.
    

    See Also

  • Attach Window
  • Cancel Token Source
  • Clear Cache
  • Click
  • Click on Cell
  • Click on Menu
  • Click on Value
  • Close Window
  • Control Screenshot
  • Count Windows
  • Expand Tree
  • Find Window
  • Find Windows
  • Focus
  • Focus Window
  • Get Barcode
  • Get Bounds
  • Get Cell Value
  • Get Control
  • Get Image Grid
  • Get Interval
  • Get Options
  • Get Table
  • Get Table Information
  • Get Tree Nodes
  • Get Value
  • Handle Open File Dialog
  • Handle Save File Dialog
  • Launch and Attach Window
  • Launch or Attach Window
  • Map Image Grid
  • Maximize or Minimize Window
  • Offset Value
  • Screenshot Window
  • Search Control
  • Select Row
  • Select Tab
  • Set Execution Throttling
  • Set Grid Value
  • Set Value
  • Update Window
  • Verify Enabled
  • Verify If Visible
  • Wait and Close Security Window
  • Wait Busy Window
  • Wait Control
  • Wait for Window to Appear
  • Wait for Window to Close
  • Watch and Close Window