Skip to content

Commands for Native/Hybrid Mobile User Interface

Worksoft SaaS supports a number of commands (constructs) to help you implement automation of tests for native/hybrid mobile applications.
 
There are many commands that are available for you to use for implementing the interaction with the User Interface of web applications within your automating tests that are also available for you to use to automate tests for native/hybrid mobile applications. All such commands are not listed in this article. Please refer to the "alphabetic (master) list of commands" or the "commands for interfacing with the User Interface of your AUT(s)" for the listing of all such commands. In those articles, the graphical icon that precedes the command name will give you a visual cue on whether or not the command is supported for test automation of web apps and native/hybrid mobile apps.

In this table below, you can see a listing of the commands grouped by the category/sub-category along with a high-level purpose of those commands.  Please note that these commands are supported currently only within the Worksoft SaaS application (Edit Test Script screen) but not in QaSCRIBE.
Main Category Sub Category Command Purpose
Device Activity assertCurrentActivity Verifies current activity's details. This command is supported only for Android Devices. On failure, execution stops.
Device Activity assertCurrentPackage Verifies current package's details. This command stops the execution if the package name doesn't match.This command is supported only for Android Devices.
Device Activity assertNotCurrentActivity Verifies current activity's details and stops execution if the command fails. This command fails if activity name matches.This command is supported only for Android Devices.
Device Activity assertNotCurrentPackage Verifies current package's details. This command stops the execution if the package name matches.This command is supported only for Android Devices.
Device Activity startActivity Starts an Android activity by providing a package name and activity name
Device Activity storeCurrentActivity Stores current activity's details.This command is supported only for Android Devices.
Device Activity storeCurrentPackage Store current package's details.  This command is supported only for Android Devices.
Device Activity verifyCurrentActivity Verifies current activity's details. This command is supported only for Android Devices.
Device Activity verifyCurrentPackage Verifies current package's details. This command is supported only for Android Devices.
Device Activity verifyNotCurrentPackage Verifies current package's details, it fails when the package name matches This command is supported only for Android Devices.
Device Activity verifyNotCurrentActivity Verifies current activity's details. This command fails if the activity name matches This command is supported only for Android Devices.
Device Activity waitForCurrentActivity Waits for current activity's details. This command is supported only for Android Devices.
Device Activity waitForCurrentPackage Waits for current package's details. This command is supported only for Android Devices.
Device Activity waitForNotCurrentActivity Waits for current activity's details.This command fails if the activity details load. This command is supported only for Android Devices.
Device Activity waitForNotCurrentPackage Waits for the current package. This command fails if the package details load.This command is supported only for Android Devices.
Device App closeApp Closes an app on the device.
Device App removeApp Removes an app from the device.
Device App resetApp Resets the currently running app for this session.
Device Files pullFile Retrieves a file from the device's file system
Device Files pullFolder Retrieves a folder from the device's file system
Device Files pushFile Place a file onto the device in a particular place
Device Interactions lock Locks the device.
Device Interactions angularRotate Rotates the device in three dimensions
Device Interactions rotate Rotates the mobile screen to portrait or landscape.
Device Interactions shake Performs a shake operation on the device. Supported only on iOS devices.
Device Interactions unlock Unlocks the device..
Device Keys hideKeyboard Hide soft keyboard.
Device Keys longPressKeyCode Press and hold a particular key code on the device.
Device Keys pressKeyCode Press a particular key code on the device.
Device Navigation storeContext Stores the Context.
Device Navigation switchContext Switches the Context from Native app to OS.
Device Network toggleLocationServices Toggles the location Icon.
Device Performance Data assertNotPerformanceData Verifies the resource usage information of the application. the resource is one of the system states which means CPU Info, Memory Info, Network Info, and Battery Info. This command is supported only for Android Devices. Execution stops if the command fails. This command fails if the value matches.
Device Performance Data assertPerformanceData Verifies the resource usage information of the application. the resource is one of the system states which means CPU Info, Memory Info, Network Info, and Battery Info. This command is supported only for Android Devices. Execution stops if the command fails.
Device Performance Data storePerformanceData Returns the resource usage information of the application. The resource is one of the system states which means CPU Info, Memory Info, Network Info, and Battery Info.  This command is supported only for Android Devices.
Device Performance Data verifyNotPerformanceData Verifies the resource usage information of the application. The resource is one of the system states which means CPU Info, Memory Info, Network Info, and Battery Info. This command is supported only for Android Devices. This command fails if the value matches.
Device Performance Data verifyPerformanceData Verifies the resource usage information of the application. The resource is one of the system states which means CPU Info, Memory Info, Network Info, and Battery Info. This command is supported only for Android Devices.
Device Performance Data waitForNotPerformanceData Waits for the resource usage information of the application. Tthe resource is one of the system states which means CPU Info, Memory Info, Network Info, and Battery Info. This command is supported only for Android Devices. Execution stops if the command fails. This command fails if the performance data is returned.
Device Performance Data waitForPerformanceData Waits for the resource usage information of the application. Tthe resource is one of the system states which means CPU Info, Memory Info, Network Info, and Battery Info. This command is supported only for Android Devices.
Device System openNotifications Opens Android notifications (Emulator only).
Device System assertNotSystemTime Verifies system's current time with the target. On failure, it stops the execution. This command passes if the time does not match.
Device System assertSystemTime Verifies system's current time with the target. On failure, it stops the execution.
Device System storeSystemTime Gets the time on the device.
Device System verifyNotSystemTime Verifies system's current time with the target. This command passes if the time does not match.
Device System   verifySystemTime Verifies system's current time with the target provided.
Device System waitForNotSystemTime Waits for system's current time to appear. This command fails if the system time doesn't appear.
Device System waitForSystemTime Waits for system's current time to appear.
Element Attributes assertElementSize Verifies the Size of an element. Stops the execution if pattern did not match.
Element Attributes storeElementSize Stores the Size of an element.
Element Attributes
 
verifyElementSize
Verifies the Size of an element.
Element Attributes Waits for Size of an element.
Element Attributes --> Attribute assertContentDescription Verifies the pattern of an element. Stops the execution if pattern did not match.
Element Attributes --> Attribute storeContentDescription Stores value in the of content-desc an element.
Element Attributes --> Attribute verifyContentDescription Verifies the pattern of content-desc an element.
Element Attributes --> Attribute waitForContentDescription Waits for the pattern of content-desc an element.
Element Attributes --> Location assertElementLocation Verifies the location of an element. Stops the execution if pattern did not match.
Element Attributes --> Location storeElementLocation Gets the location of an element.
Element Attributes --> Location verifyElementLocation Verifies the location of an element.
Element Attributes --> Location waitForElementLocation Waits for location of an element.
Element     Activity assertKeyboardVisible Pass, if the keyboard is visible else fail. Execution stops if the command fails.
Element Keys assertNotKeyboardVisible Fails, if the keyboard is visible else pass. Execution stops if the command fails.
Element Keys storeKeyboardVisible True, if keyboard is visible else false.
Element   Keys   verifyKeyboardVisible Pass, if the keyboard is visible else fail.
Element Keys verifyNotKeyboardVisible Fails, if the keyboard is visible else pass.
Element Keys waitForKeyboardVisible Waits for the keyboard to be visible. Pass, if the keyboard is visible else fail.
Element Keys waitForNotKeyboardVisible Waits for the keyboard to be visible. Fails, if the keyboard is visible else pass.
Element Mouse moveTo Finger move on the screen.
Element Mouse moveToAt Finger move on the screen using the x,y coordinates.  Coordinates should be in integer format.
Interactions Touch doubleTap This command is used to perform the double-click operation.
  Interactions   Touch doubleTapAt This command is used to perform the double-click operation using the x,y coordinates. Coordinates should be in integer format.
  Interactions   Touch dragAndDropAt drag and drop to an element. Coordinates should be in integer format.
  Interactions   Touch holdAt Simulates the user click & hold on an element without lifting finger using the x,y coordinates. Coordinates should be in integer format.
  Interactions   Touch multiFingerTapAt Taps on a touch screen at a time with multiple fingers. Coordinates should be in integer format.
  Interactions   Touch preciseTap This command is used to perform the click operation on the specified locator at the given x,y co-ordinates. Coordinates should be in integer format.
  Interactions   Touch swipe Simulates the user swiping the mobile screen up or down. Coordinates should be in integer format.
  Interactions   Touch tap This command is used to perform the click operation on the specified locator. Similar to SingleTap.
  Interactions   Touch touchDown Finger down on the screen.
  Interactions   Touch touchDownAt Finger down on the screen using the x,y coordinates. Coordinates should be in integer format.
  Interactions   Touch touchUp Finger up on the screen.
Interactions Touch --> Multi-Touch Perform twoFingerDrag Performs drag action on the touch screen using two fingers.
Interactions Touch --> Multi-Touch Perform twoFingerDoubleTouch Performs double touch action on the touch screen using two fingers.  
Interactions Touch --> Multi-Touch Perform twoFingerLongPress Performs long press on the touch screen using two fingers.  
Interactions Touch --> Multi-Touch Perform twoFingerLongPressDrag Performs long press and drag on the touch screen using two fingers.  
Interactions Touch --> Multi-Touch Perform twoFingerTouch Performs long press and drag on the touch screen using two fingers.  
Session Settings assertDeviceSettings Verifies the current settings on the device. On failure, the execution stops.
Session Settings assertNotDeviceSettings Verifies the current settings on the device. This command passes when the actual settings and settings mentioned on target do not match. On failure, it stops the command execution.
Session Settings storeDeviceSettings Stores the current settings on the device
Session   Settings   verifyDeviceSettings Verifies the current settings on the device.
Session Settings verifyNotDeviceSettings Verifies the current settings on the device. This command passes when the actual settings and settings mentioned on target do not match. 
Session Settings waitForDeviceSettings Waits for the current settings on the device.
Session Settings waitForNotDeviceSettings Waits for the current settings on the device. This command passes when the actual settings and settings mentioned on target do not match.

Feedback and Knowledge Base