Digital.ai Functions Compatible for Appium
While Appium provides an extensive list of functions to do a variety of operations during an automated test, there are several functions Digital.ai offers which can be used via an automated script to enhance the automation scripts, extending what an automation script can do, and better control the narrative.
Report Related Functions
The report-related functions enhances the quality of the test results. These functions adds custom steps, group test steps, tag them with properties, and override the final report status, helping you better categorize your tests and improve the clarity and usefulness of your test reports. This makes it easier to spot issues, track trends, and manage test results effectively.
Function | Description | Supported Commands | Documentation |
---|---|---|---|
report | Adds a custom step to the generated report in form of String | iOS & Android | Report - Automation Command |
startStepsGroup | Start a group of test steps. Can be helpful if you have long running tests with many steps. Grouping steps into expandable views can make it easier to navigate through | iOS & Android | Grouping - Automation Commands |
stopStepsGroup | Stop the grouping of test steps. Anything captured from startStepsGroup until stopStepsGroup is called will be part of that group | iOS & Android | Grouping - Automation Commands |
setGroupStatus | Being able to mark the group status with either Passed or Failed to make it easier to identify where the test failed | iOS & Android | Grouping - Automation Commands |
addTestProperty | Add custom properties to be used as a later for reporting purposes. Ability to mark tests with a custom property can help to group them together | iOS & Android | AddTestProperty - Automation Command |
setReportStatus | Overrides the final report status with either a Failed, Passed or Skipped status | iOS & Android | SetReportStatus - Automation Command |
SeeTest Client Commands
Command | Documentation | Supported OS | Comments |
---|---|---|---|
installApp | Install | iOS Android | Installs the application with the given package name or bundle ID:driver.installApp("cloud:com.experitest.ExperiBank/.LoginActivity") Installs the application with given unique name: driver.installApp("cloud:unqiueName=app_unique_name") Installs the application with given release version or build version or both: driver.installApp("cloud:com.experitest.ExperiBank/. LoginActivity:releaseVersion=1.0") driver.installApp("cloud:com.experitest.ExperiBank/.LoginActivity:buildVersion=1234") driver.installApp("cloud:com.experitest.ExperiBank/.LoginActivity:releaseVersion=1.0:buildVersion=1234") -If several matching applications are found, the latest uploaded application is installed. -The application is installed in non-instrumented mode (instrument=false). Android only:keepData: If true, this upgrades the existing application installed without losing its data. By default this is false driver.installApp("cloud:com.experitest.ExperiBank/.LoginActivity:keepData=true") |
launchWithOptions | Launch with Options | iOS Android | Example for iOS:JsonObject launchOptions = new JsonObject();</br>launchOptions.addProperty("relaunch", true);<br></br>// Create ENV vars JSON Object to pass to the application so it will run in DEBUG with a secret key<br></br>JsonObject envVars = new JsonObject();<br></br>envVars.addProperty("secret_key", "DFSF5343543CAA");<br></br>envVars.addProperty("DEBUG", true); launchOptions.add("launch_env",envVars);<br></br>driver.executeScript("seetest:client.launch", bundelId, launchOptions.toString()); Example for Android, instrumented launch:// Library that was used to build JsonObject: // implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1' JsonObject launchOptions = new JsonObject(); launchOptions.addProperty("relaunch", true); launchOptions.addProperty("instrumented", true); String appActivity = "com.experitest.ExperiBank/.LoginActivity"; driver.executeScript("seetest:client.launch", appActivity, launchOptions.toString()); Example for Android , passing multiple options: // Library that was used to build JsonObject: JsonObjectlaunchOptions = new JsonObject(); launchOptions.addProperty("-D", ""); launchOptions.addProperty("--es", "environment UAT_4_DIGITAL"); |
launch (iOS Settings URLs) | Launch | iOS | JsonObject launchOptions = new JsonObject(); driver.executeScript("seetest:client.launch", "com.apple.Preferences/App-prefs:SAFARI", launchOptions.toString()); |
simulateCapture | SimulateCapture | iOS Android | // Simulates a capture. It works only with a URL, not local filesdriver.executeScript("seetest:client.simulateCapture", "<FILE_URL>") ;// or files uploaded to the cloud through file repository driver.executeScript("seetest:client.simulateCapture", "cloud:<FILE_UNIQUE_NAME>") ; |
setAuthenticationReply | SetAuthenticationReply(Reply, Delay) - TouchID | iOS Android | |
startPerformanceTransaction | StartPerformanceTransaction | iOS Android | Starts a performance transaction. driver.executeScript("seetest:client.startPerformanceTransaction", "Monitor"); Youn need to use endPerformanceTransaction at the end |
startPerformanceTransactionForApplication | startPerformanceTransactionForApplication | iOS Android | Starts a performance transaction. driver.executeScript("seetest:client startPerformanceTransactionForApplication", "com.experitest.ExperiBank", "Monitor"); You need to use endPerformanceTransaction at the end |
endPerformanceTransaction | endPerformanceTransaction | iOS Android | driver.executeScript("seetest:client.endPerformanceTransaction", "<Report_Name>"); |
sendKeysWithBT | sendKeysWithBT | iOS Android | driver.executeScript("seetest:client.sendKeysWithBT", "" + Keys.CONTROL+ Keys.ALT + "I"); |
HybridClearCache | HybridClearCache | iOS Android | Clears the browser's cache. To continue with the test in the browser, use driver.context to set the context back to the web. Usage: driver.executeScript("seetest:client.hybridClearCache()"); |
setNetworkConnection | setNetworkConnection | Android | driver.executeScript("seetest:client.setNetworkConnection", "<MODE>", true); |
getNetworkConnection | getNetworkConnection | Android | Gets the network connection for a device. It executes any of these modes: airplane_mode wifi mobile_data bluetooth Returns true if the chosen mode is set to On in the device. driver.executeScript("seetest:client.getNetworkConnection", "<MODE>"); |
setLocationPlaybackFile | setLocationPlaybackFile | iOS Android | Changes the device location according to a series of location points provided by the Csv file in order to mimic the behavior of a location movement. LocationProvider argument is optional, Default value is GPS. When using this command, you need to set newCommandTimeout (Timeout Capabilities) capability with a bigger value than the command waiting time (that is set by the WaitForSetLocationEnd command). driver.executeScript("seetest:client.setLocationPlaybackFile", "cloud:LocationCsvFile", delay, "LocationProvider"); |
waitForSetLocationEnd | waitForSetLocationEnd | iOS Android | Specifies the waiting time for setLocationPlaybackFiledriver.executeScript("seetest:client.waitForSetLocationEnd", 5000); |
setPasscode | setPasscode | iOS | Sets the device passcode. The passcode is defined by the Cloud administrator. Therefore, the command does not take any parameters. driver.executeScript("seetest:client.setPasscode"); |
clearPasscode | SeeTest Client - clearPasscode | iOS | Clear the passcode from the device. If it fails, it throws an exception. driver.executeScript("seetest:client.clearPasscode"); |
setNetworkConditions | SeeTest Client - setNetworkConditions | iOS Android | Select the profile configured on the Network Virtualization server to test the device under the different network conditions. driver.executeScript("seetest:client.setNetworkConditions", "Monitor", 60000); |
clearLocation | SeeTest Client - ClearLocation | iOS Android | Clear the device’s location services. driver.executeScript("seetest:client.clearLocation"); |
stopLocationPlayback | SeeTest Client - stopLocationPlayback | iOS Android | Use this command to search for any active setLocation task on the device and stop it. driver.executeScript("seetest:client.stopLocationPlayback"); |
activateVoiceAssistance | SeeTest Client - ActivateVoiceAssistance | iOS Android | Use this command to activate the voice assistant service on the device (for example, Siri or Google Assistant). It sends the text parameter as if it is a spoken directive driver.executeScript("seetest:client.activateVoiceAssistance", "open google"); |
applicationClearData | ApplicationClearData | iOS Android | Use this command to clear the entire application data and cache from the device it is installed on during runtime. driver.executeScript("seetest:client.applicationClearData","com.experitest.ExperiBank/.LoginActivity"); |
For more supported Continuous Testing Cloud commands for Appium OSS, see Using The File Repository.