Get Interval
Verb: getRange
Gets the minimum, maximum, and current range values of a user interface control.
Controls are, in the context of Windows, elements that allow the user to interact with an application. Controls can be buttons, data entry fields, menus, and various other elements.
Syntax
getRange --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) [--timeout(TimeSpan)] (Numeric)=minimum (Numeric)=maximum (Numeric)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--selector | Selector | Required | ControlSelectors | Type of selector used to identify user interface controls. The following options are available:
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 | Id of the UI control. |
--name | Name | Only whenSelector is Name, NameAndValue, IdAndName, TypeAndName | Text | Name of the UI control. |
--innertext | Text | Only whenSelector is InnerTextAndTag | Text | Internal text of the UI control. |
--tagname | Element name | Only whenSelector is InnerTextAndTag | Text | The type of the element or tag.
Example: “button”, “text box”. |
--xpath | XPath | Only whenSelector is XPath | Text | XPath of the UI control. |
--classname | Class | Only whenSelector is ClassAndValue, ClassName | Text | Class of the UI control. |
--elementvalue | Element Value | Only whenSelector is ClassAndValue, NameAndValue | Text | Current value of the UI control. |
--controltype | Type | Only whenSelector is TypeAndIndex, TypeAndName | ControlTypes | The type of UI control. Options:
|
--index | Index | Only whenSelector is TypeAndIndex | Number | Index of the UI 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, fetches an element within the table. |
--searchbycolumn | Search by Column | Optional | Boolean | When enabled, fetches the element through the column, not by row. |
--searchcolumn | Column | Only whenElement in Table is True | Text | Name or number of the column from which to get the element. |
--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. |
--timeout | Timeout | Optional | Time Span, Number, Text | Command execution timeout.
In case no value is defined for the timeout parameter, the execution uses the context timeout defined by the Set Timeout command. If that command is not used on the script, the default timeout is 5 seconds. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
minimum | Minimum Value | Number | Minimum value of the control's range. |
maximum | Maximum Value | Number | Maximum value of the control's range. |
value | Current Value | Number | Current value of control's range. |
Example
The command Wait for Window to Appear waits for a Windows Explorer window to appear. The command Get Interval gets the minimum, maximum, and current values from the window search progress bar and stores those values obtained in "intervalMinimumValue", "intervalMaximumValue" and "intervalCurrentValue", respectively. The Log Message command demonstrates the results in IBM RPA Studio.
defVar --name windowSuccess --type Boolean
defVar --name intervalMinimumValue --type Numeric
defVar --name intervalMaximumValue --type Numeric
defVar --name intervalCurrentValue --type Numeric
waitWindow --title "This PC" --classname CabinetWClass --processname explorer windowSuccess=success
// If the window appears, get the range.
if --left "${windowSuccess}" --operator "Is_True"
getRange --selector "XPath" --xpath "/root/pane[2]/pane[4]/progressbar[1]" intervalMinimumValue=minimum intervalMaximumValue=maximum intervalCurrentValue=value
logMessage --message "Current: ${intervalCurrentValue}\r\nMinimum: ${intervalMinimumValue}\r\nMaximum: ${intervalMaximumValue}" --type "Info"
// Waits for an open Explorer window and gets the range of the Explorer search progress bar.
endIf
In this example it is necessary to insert in the Wait for Window to Appear command an open window with the Title equal to "This PC" if the system default is English. If the system's default language is different, the title in the Title parameter of the Wait for Window to Appear command must be altered.
Remarks
You can use the IBM RPA Studio's recorder to get the following information: