Mobile SUT Information

Use these commands and functions in your SenseTalk scripts to gather information about your Eggplant Functional mobile systems under test (SUTs).

AppList Function

Behavior: The AppList function returns a list of apps installed on an Android SUT connected through Android Gateway or an iOS SUT connected through iOS Gateway.

Parameters: None, Simple, or Full.




Returns: When you use the function with no parameter, it returns the list of apps that was most recently retrieved from the connected mobile device (possibly not since the connection was established). When called with a parameter, it requests a refreshed list of apps from the device. This updated list reflects any apps that have been installed or uninstalled since connecting to the device.

Using the Simple parameter with AppList() is much the same as using the function with no parameter except it requests an updated list of apps from the device. The returned list might appear something like the following:


When you use the Full parameter, the function requests the updated list and returns a list of property lists, where each installed app includes the following properties:

  • appID: An identifier string for the app (i.e., application ID on Android, bundle ID on iOS)
  • appName: The name of the app
  • canUninstall: true or false, whether the app can be uninstalled
  • deviceName: the name of the device where the app is installed

The output when using the Full parameter might look like this:

((appID:"", appName:"", canUninstall:"False", deviceName:"SM-G950U1"),(appID:"", appName:"", canUninstall:"False", deviceName:"SM-G950U1"),(appID:"", appName:"", canUninstall:"False", deviceName:"SM-G950U1"))


set myAppList to AppList() // Stores the return of AppList() in a variable.


if the applist contains "" // Searches the returned list of installed apps on the device for the string representing a particular package

Log "Continuing with Chrome tests now."


LogError "Chrome is not available; exiting test now." // Logs an error and marks the script as a failure if the expected package string is not part of the return

exit handler // Exits the current handler

end if


put applist(full) into myInstalledApps // Puts the list of apps into a variable

repeat with each item apps of myInstalledApps // Iterates through the list of apps

if apps.canUninstall // For each app, checks to see if it can be uninstalled

log apps.appName

end if

end repeat

GetDeviceOrientation Function

Behavior: This function returns the current rotation of the device screen. The possible values are the same as the parameters for the SetDeviceOrientation command: LandscapeLeft, LandscapeRight, Portrait, PortraitUpsideDown.

Parameters: None.



Returns: The current rotation of the device screen. For example: Portrait.


put "Device rotated to " & GetDeviceOrientation()


myDeviceOrientation "LandscapeLeft" // Calls a custom handler named "myDeviceOrientation" as a command, with one parameter value "LandscapeLeft"

to myDeviceOrientation orientation // Declares a custom handler using the generic "to" syntax. A generic handler can be called as a command or function.

if the GetDeviceOrientation is orientation then // Checks whether the current device orientation matches the desired orientation.

Log "Device is in the expected orientation." 


LogWarning "Setting device orientation now." 

SetDeviceOrientation orientation // Uses the SetDeviceOrientation command to put the SUT into the desired orientation.

end if

end myDeviceOrientation 


SUTInfo Function

Behavior: This function returns a list of properties about an Android or iOS SUT with the active connection.

Parameters: None.




log the sutInfo's device

Returns: SUT info property list. For example:

iOS: (device:"iPhone7,1", device_os_version:"iOS 10.1.1", os:"OSX", os_version:"10.12.1", type:"iOS Gateway", version:"3.4.1")

Android: (device:"SM-T230NU", device_os:"Android", device_os_version:"4.4.2", EggSensorBuildNumber:"34", EggSensorCompileTime:"Thu Oct 13 16:30:52 MDT 2016", endianess:"little-endian", manufacturer:"samsung", product:"degaswifiue", protocol_version:"2.6", SystemNative2BuildNumber:"", SystemNative2BuildTime:"2016-10-13, 22:32:05", type:"SystemNative2")


This topic was last updated on February 08, 2021, at 12:43:51 AM.

Eggplant icon | Documentation Home | User Forums | Support | Copyright © 2021 Eggplant