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
<widgetpath> [array of strings];
Mandatory/Optional
Mandatory
Example
- Each string denotes the widget ID in the hierarchy.
voltmx.automation.button.click(["frmHomeLogin", "btnLogin"]);
//Here, ["frmHomeLogin","btnLogin"]is the widget path.
- The widget path string can consist of an array indexer for SegmentedUI widget to denote the corresponding row.
voltmx.automation.button.click(["frmHomeLogin", "segUi1[0,2]", "btnLogin"]);
voltmx.automation.button.click(["frmHomeLogin", "segUi1[2]", "btnLogin"]);
- The widget path string can be a date for a Calendar cell template.
voltmx.automation.button.click(["frmHomeLogin", "calendar11[05,05,2016]", "btnLogin"]);
- The widget path string can be the friendly name of a form.
voltmx.automation.button.click(["Login Page", "userwidget1", "btnLogin"]);
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
The voltmx.automation Namespace comprises of the following Widget APIs.
voltmx.automation.actionSheet.click
Triggers the click event on the provided action item, if it is visible. If the action item is not available, this API returns the No matching actionItem found message.
Syntax
voltmx.automation.actionSheet.click("actionItemTitle");
Input Parameters
Parameters | Description |
---|---|
actionItemTitle [string] [Mandatory] | The name of the actionSheet item. |
Example
voltmx.automation.actionSheet.click("actionItemTitle");
Return Values
None
Remarks
Support for the record and playback features for this API is available from the V9 Service Pack 2 Fixpack 16 version of Volt MX Iris.
Platform Availability
- iOS
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
voltmx.automation.alert.click(<buttonIndex>);
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
voltmx.automation.alert.click(0);
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
if("testcase", async function() { var spy = spyOn(window, 'confirm').and.returnValue(true); voltmx.automation.button.click(["Form", "btn"]); expect(spy).toBe(true); });
voltmx.automation.box.click
Triggers the Box click event on the specified widget, if it is visible and enabled.
Syntax
voltmx.automation.box.click (<widgetpath>);
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
voltmx.automation.box.click(["frmHomeLogin","boxId"]);
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
voltmx.automation.button.click (<widgetpath>);
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
voltmx.automation.button.click(["frmHomeLogin","btnLogin"]);
voltmx.automation.button.click(["frmHomeLogin","segUi1[0,2]", "btnLogin"]);
voltmx.automation.button.click(["frmHomeLogin","segUi1[2]", "btnLogin"]);
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
voltmx.automation.calendar.selectDate (<widgetpath>, <newDate>);
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
voltmx.automation.calendar.selectDate(["frmHomeLogin","calenderId"], [12,15,2017]);
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
voltmx.automation.checkboxgroup.click (<widgetpath>, <chkBoxKey>);
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
voltmx.automation.checkboxgroup.click(["frmHomeLogin","checkboxgroupId"], "checkBoxKey");
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
voltmx.automation.flexcontainer.click (<widgetpath>);
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
voltmx.automation.flexcontainer.click(["frmHomeLogin","flexContainerId"]);
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
voltmx.automation.listbox.selectItem(<widgetpath>, <key>);
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
voltmx.automation.listbox.selectItem(["frmHomeLogin","listbox"], "key1");
Platform Availability
- Android
- iOS
- Windows
- SPA and ResponsiveWeb
voltmx.automation.navigationBar.click
Triggers the click event on the barButton item of the navigation bar, if it is visible and enabled.
Syntax
voltmx.automation.navigationBar.click("barButtonId");
Input Parameters
Parameters | Description |
---|---|
barButtonId [string] [Mandatory] | The ID of the BarButtonItem. |
Return Values
None
Example
voltmx.automation.navigationBar.click("barButtonId");
Remarks
Support for the record and playback features for this API is available from the V9 Service Pack 2 Fixpack 16 version of Volt MX Iris.
Platform Availability
- iOS
voltmx.automation.radiobuttongroup.click
Triggers the RadioButtonGroup click event on the specified widget, if it is visible and enabled.
Syntax
voltmx.automation.radiobuttongroup.click(<widgetpath>, <key>);
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
voltmx.automation.radiobuttongroup.click(["frmHomeLogin","rdBtnId"], "rdBtnkey");
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
voltmx.automation.segmentedui.click(<widgetpath>);
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
voltmx.automation.segmentedui.click(["frmHomeLogin","segmentedUIId[0,2]"]);
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
voltmx.automation.segmentedui.pull(<widgetpath>);
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
voltmx.automation.segmentedui.pull(["frmHomeLogin","segmentedUIId"]);
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
voltmx.automation.segmentedui.push(<widgetpath>);
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
voltmx.automation.segmentedui.push(["frmHomeLogin"," segmentedUIId "]);
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
voltmx.automation.segmentedui.scrollToRow(<widgetpath>);
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
voltmx.automation.segmentedui.scrollToRow(["frmHomeLogin"," segmentedUIId[12]"]);
voltmx.automation.segmentedui.scrollToRow(["frmHomeLogin"," segmentedUIId[1,3]"]);
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
voltmx.automation.scrollToWidget(<widgetpath>);
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
await voltmx.automation.scrollToWidget(["frmHomeLogin","btnLogin"]);
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
voltmx.automation.slider.slide(<widgetpath>, <newValue>);
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
voltmx.automation.slider.slide(["frmHomeLogin","sliderId"], 25);
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
voltmx.automation.switch.toggle(<widgetpath>);
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
voltmx.automation.switch.toggle(["frmHomeLogin","switchId"]);
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
voltmx.automation.tabpane.click(<widgetpath>, <tabID>);
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
voltmx.automation.tabpane.click(["frmHomeLogin","tabpaneId"], ”tabId”);
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
voltmx.automation.textbox.enterText(<widgetpath>, <newText>, <Array of objects with options to raise an event>);
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
voltmx.automation.textbox.enterText(["frmHomeLogin","textbox"], “sampleText”, [{ modifierCapsLock: true,
key: 'A'
}, {
modifierCapsLock: true,
key: 'B'
}, {
modifierCapsLock: false,
key: 'c'
}, {
modifierCapsLock: false,
key: 'f'
}, {
modifierCapsLock: false,
key: 'd'
}, {
modifierCapsLock: true,
key: 'E'
}, {
modifierCapsLock: false,
keyCode: 13
} // For enter key
]);
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
voltmx.automation.textarea.enterText(<widgetpath>, <newText>, <Array of objects with options to raise an event>);
Input Parameters
Parameter | Description |
---|---|
widgetp |