Automation API
Quantum Visualizer Automation Framework
Quantum Visualizer Automation Framework provides you a more convenient way to test your application across various platforms. The framework follows the Write Once, Run Anywhere methodology, so that different automation efforts put for each platform for the same application can be reused. JavaScript is used for Quantum Visualizer Automation, and you do not need to have expertise on any other native language to use it. It is currently supported on iOS, Android, and DesktopWeb platforms.
JavaScript Testing Framework – Jasmine
Jasmine is a behavior-driven development framework for testing JavaScript code. The framework does not depend on any other JavaScript frameworks. Furthermore, the framework has a clear and obvious syntax, thus enabling you to easily write tests.
Sample Code
Consider a scenario of a login page. Following is the test case written in JavaScript to verify if the username is Linda.
describe("Sample 1", function() { it("test case1", async function() { var username = kony.automation.widget.getWidgetProperty(["LoginPage", "loginBox", "userName"], "text"); expect(username).toEqual("Linda"); // assertion for username value }); });
API | Simplified way of Invoking the API |
---|
API | Simplified way of invoking the API |
---|
Quantum Visualizer Automation APIs: Supported Items
Quantum Visualizer Supports automation for both MVC and non-MVC projects. Automation API supports the following widgets:
- All views of all widgets
- Platform-specific widgets
- Masters and User widgets (components)
- Deprecated widgets - Box, Form, ScrollBox, etc.
In addition, Automation API supports the following items:
- Low-level actions on all supported widgets
- Touch
- Scroll
- Hardware buttons
- Back button
- Menu button
- Text entry
- Camera capture
- Map and browser interaction
Quantum Visualizer Automation API consists of the kony.automation Namespace and its following inherent API groups:
- Widget APIs
- Low-level Touch and Gesture APIs
- Miscellaneous Automation APIs
- Existing Quantum Visualizer APIs
The Quantum Visualizer Automation API uses the kony.Automation
namespace and the following API elements:
Methods | Description |
---|---|
|
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. |
|
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. |
kony.automation.box.click
|
Triggers the Box click event on the specified widget, if it is visible and enabled. |
kony.automation.button.click
|
Triggers the Button click event on the specified widget, if it is visible and enabled. |
kony.automation.calendar.selectDate
|
Triggers the Calendar click event on the specified widget, if it is visible and enabled. |
kony.automation.checkboxgroup.click
|
Triggers the CheckBoxGroup click event on the specified widget, if it is visible and enabled. |
kony.automation.flexcontainer.click
|
Triggers the FlexContainer click event on the specified widget, if it is visible and enabled. |
kony.automation.listbox.selectItem
|
Triggers the ListBox click event on the specified widget, if it is visible and enabled. |
kony.automation.navigationBar.click
|
Triggers the click event on the barButton item of the navigation bar, if it is visible and enabled. |
kony.automation.radiobuttongroup.click
|
Triggers the RadioButtonGroup click event on the specified widget, if it is visible and enabled. |
kony.automation.segmentedui.click
|
Triggers the SegmentedUI click event on the specified widget, if it is visible and enabled. |
kony.automation.segmentedui.pull
|
Triggers the onPull event on the SegmentedUI, if it is set. |
kony.automation.segmentedui.push
|
Triggers the onPush event on the SegmentedUI, if it is set. |
kony.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. |
kony.automation.segmentedui.scrollToWidget
|
Scrolls to ensure that the widget appears in view. It is an awaitable API. |
kony.automation.slider.slide
|
Triggers the Slider slide event on the specified widget, if it is visible and enabled. |
kony.automation.switch.toggle
|
Toggles the Switch between ON/OFF on the specified widget, if it is visible and enabled. |
kony.automation.tabpane.click
|
Clicks the tab with the specified tabID on the TabPane widget, if it is visible and enabled. |
kony.automation.textbox.enterText
|
Enters the specified text into the TextBox, if it is visible and enabled. |
kony.automation.textarea.enterText
|
Enters the specified text into the TextArea, if it is visible and enabled. |
kony.automation.widget.touch
|
Triggers the touch event on the specified widget, if it is visible and enabled. |
kony.automation.playback.getCurrentForm
|
Returns the name of the current Form. |
kony.automation.getWidgetsByFilter
|
Retrieves the paths of the child widgets of the container widget, based on the filters applied. |
kony.automation.playback.isLoadingScreenVisible
|
Returns the status of visibility of the loading screen. |
kony.automation.playback.wait
|
Introduces a delay time in the playback as specified. It is an awaitable API. |
kony.automation.playback.waitFor
|
Waits for the widget to load completely. It is an awaitable API. |
kony.automation.playback.waitForLoadingScreenToDismiss
|
This API blocks user action until the loading screen is dismissed (or disappears). This is an awaitable API. |
kony.automation.widget.getWidgetProperty
|
Returns the particular Kony-defined property on the specified widget. |
kony.automation.device.deviceBack
|
Invokes the back action of the device. It is an awaitable API. |
kony.automation.capture
|
Takes a screenshot of the widget passed. If the widget does not pass, the screenshot captures the entire screen. |
kony.automation.getParentInfo
|
Returns a JSON Object (dictionary) that contains the details of the application that launched the current app. |
kony.automation.launchApp
|
Launches a new app from the current app . |
kony.automation.sendEvent
|
Sends a message to another app that is associated with the current app. By using this API, you can resume the second application from the first and vice versa. |
kony.automation.sendEventToParent
|
Sends a message to the parent app that is associated with the current app. By using this API, you can resume the application that launched the current application. |
kony.automation.waitForEvent
|
Waits for the instructions from the other app that this API is used for. This API waits indefinitely to receive the instruction (with the same eventName) from the other app to resume execution. |
kony.print
|
Prints debugging output. |
kony.os.deviceInfo
|
Allows the developers to get information about the device in which the application is launched. |