voltmx.automation Namespace
The voltmx.automation Namespace consists of the following API groups.
Widget APIs
Widget Path
Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. It is applicable for almost all widget APIs.
Note: When you build an app in Test Mode, if the app contains components (with contract), the programmatic names of the properties must be unique. Ensure that the properties do not have the same name as that of any child widgets in the component or the parent FlexContainer widget. If a property and a widget (child or parent) have the same name, the property will not be honored.
Note: Whenever a Segment row is a part of Widget path, it refers to the top level flex. This flex ID should not be provided in the subsequent path.
Syntax
Mandatory/Optional
Mandatory
Example
- Each string denotes the widget ID in the hierarchy.
- The widget path string can consist of an array indexer for SegmentedUI widget to denote the corresponding row.
- The widget path string can be a date for a Calendar cell template.
- The widget path string can be the friendly name of a form.
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
The voltmx.automation Namespace comprises of the following Widget APIs.
voltmx.automation.alert.click
Clicks the provided button, if visible, for the Alert. If multiple alerts are simultaneously shown, this API clicks the most recent alert displayed on the screen.
Syntax
Input Parameters
Parameters | Description |
---|---|
buttonIndex [0 or 1] [Optional] | Alert widget supports two buttons. This APIs triggers the click on the YES label if the index is 0, and it triggers the click on the NO label if the index is 1. If the alert type is information, this API triggers the click on the OK label if the index is 0. If you do not pass any buttonIndex, the API triggers the click on the NO label for confirmation alerts and the OK label for information alerts. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
Remarks
While using Jasmine Test Automation on the Adaptive Web or Responsive Web platforms, you can use the spyon API that is provided by Jasmine to gain more control over the alerts.
For Example, you can use the var spy = spyOn(window, '<method>').and.returnValue(<value>);
code snippet to always return the value that you specify.
The value of
-
For information and error alerts, replace
<method>
withalert
, and replace the<value>
parameter withtrue
. -
For confirmation alerts, replace
<method>
withconfirm
, and replace the<value>
parameter with eithertrue
orfalse
.
Example
voltmx.automation.box.click
Triggers the Box click event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and Responsive Web
voltmx.automation.button.click
Triggers the Button click event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.calendar.selectDate
Triggers the Calendar click event on the specified widget, if it is visible and enabled.
Note: Supported view type is pop-up grid
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
newDate [array] [Mandatory] | Array representation of a date in mm/dd/yyyy format as [mm, dd, yyyy] co-ordinate. This format is irrespective of the calendar format. |
Example
Return Values
None
Note: Automation is supported only for the Calendar default view.
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.checkboxgroup.click
Triggers the CheckBoxGroup click event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
chkBoxKey [array/integer] [Mandatory] | CheckBoxGroup item that is to be clicked. > Note: The value of the chkBoxKey must be an Integer for the Table viewType. For all other viewTypes, the value of the chkBoxKey must be an array. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.flexcontainer.click
Triggers the FlexContainer click event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.listbox.selectItem
Triggers the ListBox click event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
key [string/integer] [Mandatory] | Indicates the key in the ListBox for which item is to be clicked. > Note: The value of the key must be an Integer for the Table viewType. For all other viewTypes, the value of the key must be a string. |
Return Values
None
Example
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.radiobuttongroup.click
Triggers the RadioButtonGroup click event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
key [string/integer] [Mandatory] | Radiobutton key that needs to be clicked. > Note: The value of the key must be an Integer for the Table viewType. For all other viewTypes, the value of the key must be a string. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.segmentedui.click
Triggers the SegmentedUI click event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Note: Automation is supported only for the Segment table view.
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.segmentedui.pull
Triggers the onPull event on the SegmentedUI, if it is set.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Note: Automation is supported only for the Segment table view.
Platform Availability
- Android
- iOS
- ResponsiveWeb
voltmx.automation.segmentedui.push
Triggers the onPush event on the SegmentedUI, if it is set.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Note: Automation is supported only for the Segment table view.
Platform Availability
- Android
- iOS
- ResponsiveWeb
voltmx.automation.segmentedui.scrollToRow
Triggers the segment to scroll to the row specified by the index of the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Note: Automation is supported only for the Segment table view.
Remarks
The voltmx.automation.segmentedui.scrollToRow API does not work on the section header of the Segment.
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.scrollToWidget
Scrolls to ensure that the widget appears in view. It is an awaitable API.
Syntax
Input Parameters
Parameter | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Note: If segment is a part of widgetpath, then it scrolls only to the segment.
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.slider.slide
Triggers the Slider slide event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
newValue [number] [Mandatory] | New slider value within a minimum and maximum range. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.switch.toggle
Toggles the Switch between ON/OFF on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameter | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.tabpane.click
Clicks the tab with the specified tabID on the TabPane widget, if it is visible and enabled.
Syntax
Input Parameter
Parameter | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
tabID [string] [Mandatory] | The tabID name. |
Example
Note: Automation is supported only for the TabPane default view.
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.textbox.enterText
Enters the specified text into the TextBox, if it is visible and enabled.
Syntax
Input Parameters
Parameter | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
newText [string] [Mandatory] | New text to be set to the TextBox. Specify null to clear the text. |
Array of Objects [array of objects] [Optional] | An array of JSON Objects where each object contains options that can be specified as part of the KeyboardEvent Object, such as key, keyCode, Event Modifier Initializers. > Note: This parameter is only available on the Responsive Web platform. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA
- Responsive Web
voltmx.automation.textarea.enterText
Enters the specified text into the TextArea, if it is visible and enabled.
Syntax
Input Parameters
Parameter | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
newText [string] [Mandatory] | New text to be set to the TextArea. Specify null to clear the text. |
Array of Objects [array of objects] [Optional] | An array of JSON Objects where each object contains options that can be specified as part of the KeyboardEvent Object, such as key, keyCode, Event Modifier Initializers. > Note: This parameter is only available on the Responsive Web platform. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA
- Responsive Web
Low-level Touch and Gesture APIs
The voltmx.automation Namespace comprises of the following Low-level Touch and Gesture APIs.
voltmx.automation.widget.touch
Triggers the touch event on the specified widget, if it is visible and enabled.
Syntax
Input Parameters
Parameter | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
startPoint [array] [Mandatory] | Represents the start point as [x, y] co-ordinates. Alternatively, this can be assigned a null value. |
movePoints [array] [Mandatory] | Represents an array of interim points such as [[x1, y1], [x2, y2]…[xn, yn]]. Alternatively, this can be assigned a null value. |
endpoint [array] [Mandatory] | Represents the end point as [x, y] co-ordinates. Alternatively, this can be assigned a null value. |
Array of Objects [array of objects] [Optional] | An array of JSON Objects where each object contains options that can be specified as part of the KeyboardEvent Object, such as Event Modifier Initializers. > Note: This parameter is only available on the Responsive Web platform. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA
- Responsive Web
Miscellaneous Automation APIs
The voltmx.automation Namespace comprises of the following miscellaneous Automation APIs.
voltmx.automation.getCurrentForm
Returns the name of the current Form.
Syntax
Input Parameters
None
Example
Return Values
String - Returns the Form ID of the current Form.
Platform Availability
- Android
- iOS
- SPA
- Responsive Web
voltmx.automation.getWidgetsByFilter
Retrieves the paths of the child widgets of the container widget, based on the filters applied.
Syntax
Input Parameters
Parameters | Description |
---|---|
containerWidgetPath[Array] | This is a mandatory parameter. This parameter specifies the path of the container widget for which the search and filter criteria must be applied. The ContainerWidgetPath parameter only accepts the paths of container widgets such as Form and FlexContainer and FlexScrollContainer widgets. > Note: Volt MX Iris does not provide support to apply search filters for the child widgets of group widgets (such as Segment, ListBox, TabPane, and Components). However, you can search for the properties of the group widgets. |
filters [Array] | This is a mandatory parameter. This parameter contains an array of search conditions. If you provide multiple filters, only the widget paths that satisfy all the filters are returned. The array for the Filters parameter must contain the following information: property [String]: Specifies the widget property for which the search criteria applies. value [Object]: Specifies the value of the widget property for which the search criteria applies. The JSON Object can have a String, Number, or Boolean value. caseSensitive [Boolean]: Specifies if the search criteria for the property parameter must consider the case of the string. The default value for this key is true. This is an optional parameter and is only applicable if the type of the value parameter is String. searchCriteria [Constant]: Specifies the criteria for searching the value of a property. This is an optional parameter and can have the following constant values for supported criteria:voltmx.automation.SEARCH_CRITERIA_EQUALvoltmx.automation.SEARCH_CRITERIA_CONTAINSvoltmx.automation.SEARCH_CRITERIA_STARTSWITHvoltmx.automation.SEARCH_CRITERIA_ENDSWITHvoltmx.automation.SEARCH_CRITERIA_GREATERvoltmx.automation.SEARCH_CRITERIA_GREATER_EQUALvoltmx.automation.SEARCH_CRITERIA_LESSERvoltmx.automation.SEARCH_CRITERIA_LESSER_EQUAL> Note: The default value for this parameter is voltmx.automation.SEARCH_CRITERIA_EQUAL. |
searchableWidgets [Array of Constants] | This is an optional parameter. This parameter contains an array of constants that specify the widgets to be searched. The array for the searchableWidgets parameter can contain the following widget constants: voltmx.automation.widget.BUTTON voltmx.automation.widget.CALENDAR voltmx.automation.widget.CHECKBOXGROUP voltmx.automation.widget.FLEXCONTAINER voltmx.automation.widget.FLEXSCROLLCONTAINER voltmx.automation.widget.LABEL voltmx.automation.widget.LISTBOX voltmx.automation.widget.RADIOBUTTONGROUP voltmx.automation.widget.SEGMENTEDUI voltmx.automation.widget.SLIDER voltmx.automation.widget.SWITCH voltmx.automation.widget.TABPANE voltmx.automation.widget.TEXTAREA voltmx.automation.widget.TEXTBOX |
Example 1
Example 2
Return Values
Array of widget paths (in an array format) that satisfy the search criteria.
For Example, [ [“Form1”, “bnt1”], [“Form2”, “btn2”] ]
Platform Availability
- Android
- iOS
- SPA
- Responsive Web
voltmx.automation.playback.isLoadingScreenVisible
Returns the status of visibility of the loading screen.
Syntax
Input Parameters
None
Example
Return Values
Boolean
Returns true if the loading screen is visible on the screen.
Returns false if the loading screen is not visible on the screen.
Platform Availability
- Android
- iOS
- SPA and ResponsiveWeb
voltmx.automation.playback.wait
Introduces a delay time in the playback as specified. It is an awaitable API.
Syntax
Input Parameters
Parameter | Description |
---|---|
delayTime [number] [Mandatory] | Time delay in millisecond. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.playback.waitFor
Waits for the widget to load completely. It is an awaitable API.
Syntax
Input Parameters
Parameters | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
timeout [number] | It is an optional parameter. The timeout parameter must be specified in milliseconds. If the timeout is not specified, the API waits until the widget appears. |
Example
Return Values
Boolean
Returns true if the widget is found within the timeout period.
Returns false if the wdget is not found within the timeout period.
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.playback.waitForLoadingScreenToBeDismissed
Waits for the loading screen to be dismissed or disappear. It is an awaitable API.
Syntax
Input Parameters
Parameters | Description |
---|---|
timeout [number] | It is an optional parameter. The timeout parameter must be specified in milliseconds. If the timeout is not specified, the API waits until the widget appears. |
Example
Return Values
Boolean
Returns true if there is no loading screen or the loading screen has disappeared.
Returns false if the loading screen is visible on the screen.
Platform Availability
- Android
- iOS
- SPA and ResponsiveWeb
voltmx.automation.widget.getWidgetProperty
Returns the particular Volt MX-defined property on the specified widget.
Syntax
Input Parameters
Parameter | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. |
propertyName [string] [Mandatory] | Widget property name. |
Example
Return Values
The value of the property specified for the widget
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.device.deviceBack
Invokes the back action of the device. It is an awaitable API.
Syntax
Input Parameters
None
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.capture
The api takes a screenshot of the widget passed. If the widget does not pass, the screenshot captures the entire screen.
Syntax
Input Parameters
Parameter | Description |
---|---|
widgetpath [array of strings] [Mandatory] | Widget ID from root element (form, and master, etc.). Comma-separated strings from root to widget represented in an array. If you do not specify this parameter, the screenshot of the entire current screen is taken. |
Example
Return Values
None
Platform Availability
- Android
- iOS
- Windows
Existing Volt MX Iris APIs
You can use the following existing Volt MX Iris APIs for Automation. The respective Syntax and usage remain the same.