Offset Value
Verb: offsetValue
Offsets the value of a track bar in units, decreasing or increasing it.
Syntax
offsetValue [--decrease(Boolean)] --modifyby(Numeric) --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)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--decrease | Decrease | Optional | Boolean | When enabled, the value of the element is decreased.
Leave it disabled to increase the value. |
--modifyby | Offset | Required | Number | Number representing the amount of units to offset the track bar from its current position. |
--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 user interface control from which the track bar value should be changed. |
--name | Name | Only whenSelector is Name, NameAndValue, IdAndName, TypeAndName | Text | Name of the user interface control from which the track bar value should be changed. |
--innertext | Text | Only whenSelector is InnerTextAndTag | Text | Inner text of the user interface control from which the track bar value should be changed. |
--tagname | Element Value | Only whenSelector is InnerTextAndTag | Text | Type of the element from which the track bar value should be changed. |
--xpath | XPath | Only whenSelector is XPath | Text | XPath that leads to the control from which the track bar value should be changed. |
--classname | Class | Only whenSelector is ClassAndValue, ClassName | Text | Class of the user interface control from which the track bar value should be changed. |
--elementvalue | Element Value | Only whenSelector is ClassAndValue, NameAndValue | Text | Current value of the user interface control from which the track bar value should be changed. |
--controltype | Type | Only whenSelector is TypeAndIndex, TypeAndName | ControlTypes | Type of user interface control from which the track bar value should be changed.
Options: |
--index | Index | Only whenSelector is TypeAndIndex | Number | Index of the user interface control from which the track bar value should be changed. |
--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 a table by column or row. |
--searchbycolumn | Search by Column | Optional | Boolean | When enabled, searches for the element by the column, not by line. |
--searchcolumn | Column | Only whenElement in Table is True | Text | Name or number of the column from which the element is obtained. |
--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 | Maximum time limit to execute the command.
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 |
---|---|---|---|
value | Value | Number | Returns the value of the track bar after the offsetting. |
Example
The Offset Value command increases an informed track bar by 20 units.
defVar --name modifiedValue --type Numeric
// Open the program with the trackbar.
// Download the following application to execute the command.
launchWindow --executablepath "CSharpTestApp.exe"
// Shifts the trackbar by 20.
offsetValue --modifyby 20 --selector "Id" --id trackBar1 modifiedValue=value
logMessage --message "${modifiedValue}" --type "Info"
// Returns the number with the number of units the track bar was offset.
// 20
For the correct operation of the above script, it is necessary to download the application and insert its path in the parameter Executable of the command Launch and Attach Window.
Remarks
To use the Offset Value command, it is necessary to use the IBM RPA Studio's recorder to find the trackbar and map it.
It is possible to use the IBM RPA Studio's recorder to obtain the following information: