Skip to main content

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.

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.

FunctionDescriptionSupported CommandsDocumentation
reportAdds a custom step to the generated report in form of StringiOS & AndroidReport - Automation Command
startStepsGroupStart 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 throughiOS & AndroidGrouping - Automation Commands
stopStepsGroupStop the grouping of test steps. Anything captured from startStepsGroup until stopStepsGroup is called will be part of that groupiOS & AndroidGrouping - Automation Commands
setGroupStatusBeing able to mark the group status with either Passed or Failed to make it easier to identify where the test failediOS & AndroidGrouping - Automation Commands
addTestPropertyAdd custom properties to be used as a later for reporting purposes. Ability to mark tests with a custom property can help to group them togetheriOS & AndroidAddTestProperty - Automation Command
setReportStatusOverrides the final report status with either a Failed, Passed or Skipped statusiOS & AndroidSetReportStatus - Automation Command

SeeTest Client Commands

CommandDocumentationSupported OSComments
installAppInstalliOS AndroidInstalls 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")
launchWithOptionsLaunch with OptionsiOS AndroidExample 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)LaunchiOSJsonObject launchOptions = new JsonObject();
driver.executeScript("seetest:client.launch", "com.apple.Preferences/App-prefs:SAFARI", launchOptions.toString());
simulateCaptureSimulateCaptureiOS Android// Simulates a capture. It works only with a URL, not local files
driver.executeScript("seetest:client.simulateCapture", "<FILE_URL>");
// or files uploaded to the cloud through file repository
driver.executeScript("seetest:client.simulateCapture", "cloud:<FILE_UNIQUE_NAME>");
setAuthenticationReplySetAuthenticationReply(Reply, Delay) - TouchIDiOS Android
startPerformanceTransactionStartPerformanceTransactioniOS AndroidStarts a performance transaction.
driver.executeScript("seetest:client.startPerformanceTransaction", "Monitor");
Youn need to use endPerformanceTransaction at the end
startPerformanceTransactionForApplicationstartPerformanceTransactionForApplicationiOS AndroidStarts a performance transaction.
driver.executeScript("seetest:client
startPerformanceTransactionForApplication", "com.experitest.ExperiBank", "Monitor");
You need to use endPerformanceTransaction at the end
endPerformanceTransactionendPerformanceTransactioniOS Androiddriver.executeScript("seetest:client.endPerformanceTransaction", "<Report_Name>");
sendKeysWithBTsendKeysWithBTiOS Androiddriver.executeScript("seetest:client.sendKeysWithBT", "" + Keys.CONTROL+ Keys.ALT + "I");
HybridClearCacheHybridClearCacheiOS AndroidClears 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()");
setNetworkConnectionsetNetworkConnectionAndroiddriver.executeScript("seetest:client.setNetworkConnection", "<MODE>", true);
getNetworkConnectiongetNetworkConnectionAndroidGets 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>");
setLocationPlaybackFilesetLocationPlaybackFileiOS AndroidChanges 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");
waitForSetLocationEndwaitForSetLocationEndiOS AndroidSpecifies the waiting time for setLocationPlaybackFiledriver.executeScript("seetest:client.waitForSetLocationEnd", 5000);
setPasscodesetPasscodeiOSSets the device passcode.
The passcode is defined by the Cloud administrator. Therefore, the command does not take any parameters.
driver.executeScript("seetest:client.setPasscode");
clearPasscodeSeeTest Client - clearPasscodeiOSClear the passcode from the device. If it fails, it throws an exception.
driver.executeScript("seetest:client.clearPasscode");
setNetworkConditionsSeeTest Client - setNetworkConditionsiOS AndroidSelect the profile configured on the Network Virtualization server to test the device under the different network conditions.
driver.executeScript("seetest:client.setNetworkConditions", "Monitor", 60000);
clearLocationSeeTest Client - ClearLocationiOS AndroidClear the device’s location services.
driver.executeScript("seetest:client.clearLocation");
stopLocationPlaybackSeeTest Client - stopLocationPlaybackiOS AndroidUse this command to search for any active setLocation task on the device and stop it.
driver.executeScript("seetest:client.stopLocationPlayback");
activateVoiceAssistanceSeeTest Client - ActivateVoiceAssistanceiOS AndroidUse 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");
applicationClearDataApplicationClearDataiOS AndroidUse 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");
info

For more supported Continuous Testing Cloud commands for Appium OSS, see Using The File Repository.