SUT Information and Control
These commands and functions let you use SenseTalk scripts to connect to your systems under test (SUTs) from Eggplant Functional as well as gather information about connections and other SUT information.
AllConnectionInfo
Function
Behavior: Returns all connection property lists. The return also includes connection property lists for any ad-hoc connections created during the session using the Connect command.
Parameters: None.
Returns: A list of connection property lists for all of the SUTs in the Connection List. For example:
[{AndroidDevice:"True", Availability:"Unknown", Bonjour:"False", ColorDepth:"0", Connected:"False", DeviceSerialNumber:"b6dcc079", Name:"GalaxyS5", PortNum:"5900", Reverse:"False", ServerID:"SM-G900V (b6dcc079)", Status:"Not Connected", Type:"vnc", Visible:"False"},{Availability:"Unknown", Bonjour:"False", ColorDepth:"0", Connected:"False", Name:"Linux", PortNum:"5900", Reverse:"False", ScreenSize:[1024,768], ServerID:"192.168.120.137", Status:"Not Connected", Type:"vnc", Visible:"False"}]
Example:
put the AllConnectionInfo into HostList //Stores the return of the AllConnectionInfo function into a variable named HostList
Related:
Connect
Command
Behavior: Opens a connection with a SUT, or makes a connected SUT the active SUT. If you pass a connection property list, overrides the properties you set.
Parameters: A hostname, IP address, or display name from the Connection List. Alternatively, one connection property list.
If the SUT is not in your Connection List, or if you need to override information in the Connection List, you can pass in a connection property list. When running a script via the command line or via a different machine than your script development machine, the execution often does not have access to your Connection List. Therefore, regularly using the Connect
command with a complete connection property list is highly recommended.
Syntax:
Connect nameOrServerID {, port {, password}} {, connectionPropertyList}
Connect connectionPropertyList
When the first syntax is used, nameOrServerID should be either the name of an existing connection in the Connection List or an appropriate ServerID for the specific type of connection being made. This may optionally be followed by a port number, a password and/or a connectionPropertyList to supply any additional properties. The second syntax simply provides a connectionPropertyList, as described below.
Eggplant Functional supports several different types of SUT connections, including the following. Additional information about the connection types follows this list:
- VNC Servers –
type:"VNC"
or not specified (this is the default type) - RDP Servers –
type:"RDP"
- Sauce Labs Browsers and Devices –
type:"SauceLabs"
- Citrix Servers -
type:"Citrix"
- Single System - No associated
type
. You must create and save a Single System-type connection in the Connection List and then pass its name with theconnect
command. See Single System Connections below for details. - Screenshot files –
type:"Screenshot"
- The Tutorial SUT – Use
"TutorialSUT"
as the nameOrServerID. This is a dummy SUT for training and exploration purposes.
When connecting to anything other than a VNC server or the Tutorial SUT, a connectionPropertyList must be used to supply at least the type
property as indicated in the list above. The other connection properties that may be used vary depending on the type of connection.
Connecting to Eggplant Automation Cloud Devices: For information about connecting to devices hosted in Eggplant Automation Cloud using the Connect
command, see Connecting to Eggplant Automation Cloud Test Systems.
VNC and RDP connections
The connection properties for VNC and RDP connections (all optional except as noted) are:
- Type: Must be "RDP" for an RDP connection, "VNC" (or omitted) for a VNC connection. The method to use to connect to the SUT. (Default value: VNC.)
- ServerID: The hostname, IP address, or Connection List Display Name. This is the only required property for a VNC connection.
- PortNum: The port number used by the server on the SUT. (Default value: 5900 for VNC; 3389 for RDP.)
- Username: The Windows username when connecting via RDP. (Default value: none.)
- Password: The password for the VNC server if you're making a VNC connection, or the Windows user password if you're making an RDP connection. (Default value: None. Note, however, that RDP connections require a password.)
- sshHost: The hostname or IP address of a computer hosting an SSH connection. (Default value: none.)
- sshUser: The user account on the SSH host (Default value: none.)
- sshPassword: The password to the user account on the SSH server. (Default value: none.)
- Visible: Specifies whether the Viewer window automatically opens upon connection. (Valid values: Yes or No.)
- ColorDepth: The color depth of the SUT in the Viewer window: 8, 16, 32. (Default value: The native color depth of the SUT.)
- Height: For RDP connection types only, specifies the height of the Viewer window in pixels. (Default value: 768.)
- Width: For RDP connection types only, specifies the width of the Viewer window in pixels. (Default value: 1024.)
- scaleRemoteScreen: When set to YES, scales mobile VNC servers by 50 percent in each dimension. This option provides better performance when you're using mobile devices with large screens or high resolution.
- blendScaledScreen: When set to YES, blends pixel colors when you're using
scaleRemoteScreen
. This option should be used only for backward compatibility with older scripts or images.
- blendScaledScreen: When set to YES, blends pixel colors when you're using
- monitorCount: Specifies the number of monitors for an RDP connection. Takes a value between 1 and 5.
Sauce Labs Connections
When making a Sauce Labs connection, you must include either a BrowserName
property for connecting to a browser, or a DeviceName
property for connecting to a device.
The connection properties for both types of Sauce Labs connections are:
- Type: "SauceLabs" (Required)
- Name: The name to assign to this connection. (Optional – if not given, a name like "Sauce Labs 1" will be assigned)
- User: The user name for the Sauce Labs account being used. (Required)
- APIKey: The Sauce Labs API key for the account. (Required)
- DataCenter: The Sauce Labs data center to connect to. (Required)
- Visible: Specifies whether the Viewer window automatically opens upon connection. (Optional – Valid values: Yes or No)
For Browser connections
- BrowserName: The name of the browser, such as "Chrome", "Firefox", etc. (Required)
- PlatformName: The name of the operating system platform, such as "Windows 10". (Required)
- URL: The URL of the site to connect to in the browser. (Required)
- BrowserVersion: Specific browser version requested. (Optional)
- ScreenResolution: The browser screen size in the form width X height, such as "1400x1050". (Optional)
For Device connections
- DeviceName: The device identifier, such as "Iphone 12", etc. (Required)
- PlatformName: The name of the operating system platform, such as "iOS", "Android", etc. (Required)
- App: The URL of the app to execute on the device. (Required)
Sauce Labs Tunnel Proxies Options
Sauce labs tunnels can be used to connect to both Sauce Labs browsers and devices.
To use the Sauce Labs Tunnel Proxy functionality, you must first have the Sauce Connect Proxy installed and running on the same machine as Eggplant Functional. Please see Connecting Using Sauce Connect Proxy for more information.
- Tunnel Name: The name of the active Sauce Connect tunnel to use when connecting to Sauce Labs. (Optional)
- Tunnel Owner: The name of the Sauce Labs user account that was used to establish the active Sauce Connect tunnel. (Optional)
Citrix connections
When making a Citrix connection, the following properties are used:
- Type: "Citrix" (Required)
- Name: The name to assign to this connection. (Optional – if not given, a name like "Citrix 1" will be assigned)
- User: The user name for the Citrix connection. (Required)
- Password: The user password for the Citrix connection. (Required)
- StorefrontURL: The URL of the Citrix storefront. (Required)
- Application: The title of the Citrix application to launch, as listed in the Citrix Storefront application. (Required)
- Visible: Specifies whether the Viewer window automatically opens upon connection. (Optional – Valid values: Yes or No)
- ScreenResolution: The resolution of the Citrix SUT. (Optional - defaults to 1600x900)
- ScreenshotInterval: The time in milliseconds between screen captures of the Citrix SUT. (Optional - defaults to 400)
Mobile Device Connections
When connecting to a mobile device which is connected directly to the system running Eggplant Functional, the required properties depend on the OS of the device being connected. Currently, Eggplant functional supports Mobile Device Connections for iOS and Android devices.
If this is your first time connecting a mobile device to Eggplant Functional, we suggest that you review Connecting to Mobile Devices for general concepts related to testing mobile devices. Additionally, depending on the type of device you plan to test, you should review Working with Android Mobile Devices or Working with iOS Mobile Devices for details related to your specific device.
For Android Device Connections:
- Type: "Mobile Device" (Required)
- Name: The name to assign to this connection. (Optional – if not given, a name will be assigned)
- DeviceID: The Device ID of the device to connect (Required - See Note below)
If only one device is connected to your system, you can specify a DeviceID of "connected" and Eggplant Functional will automatically connect to that device. If you have more than one device connected, this field is required. Please see Getting Android Mobile Device IDs and Connecting to Android Emulators for details on working with Device IDs.
For iOS Device Connections:
- Type: "Mobile Device" (Required)
- Name: The name to assign to this connection. (Optional – if not given, a name will be assigned)
- DeviceUDID: The Unique DeviceID of the device to connect (Required - See Note below)
- ProvisioningProfilePath: The fully qualified name of the file which contains your Provisioning Profile (Required)
- DeveloperCertificatePath: The fully qualified name of the file which contains your Developer Certificate (Required)
- DeveloperCertificatePath: The password for your Developer Certificate (Required)
- DeveloperDiskPath: The path to the top-level directory which contains all of the Developer Disks for your chosen hardware platform. See Ensure You Have Your Developer Disks for details (Required)
If only one device is connected to your system, you can specify a DeviceUDID of "connected" and Eggplant Functional will automatically connect to that device. If you have more than one device connected, this parameter is required. Please see Getting iOS Mobile Unique Device IDs for details on working with Device UDIDs.
Single System Connections
You must create a Single System SUT connection using the add/edit connection panel in the Connection List before you can use it with the connect
command. Similarly, you must modify Single System connections through the Connection List.
You can use the Connect
command to establish or activate a Single System connection but you must first create and save the connection through the Connection List. Once the connection is saved in the Connection list, you can use it with the connect
command in a script by passing the connection's name. This is either the Display Name or the value in the Server field when a Display Name is not provided. See Using the Eggplant Functional Connection List and Single System Specific Options for more information.
To see an example of how to write SenseTalk connect
command to use a Single System connection in a script, see the Example (by name) Connect
Command Examples below.
Screenshot Connections
To open a screenshot connection, all that is needed is the path to a screenshot image on the local computer. While there is no interaction possible with a static image, a screenshot connection can be very useful for capturing images and for experimenting with search properties for both images and text.
- Type: "Screenshot" (Required)
- Name: The full path to the screenshot image file. (Required, either as a "Name" property, or as the first (unlabeled) parameter)
If you have already connected to a SUT, you can retrieve the associated connection property list with the ConnectionInfo
function.
Connect
Command Examples
Example (by name):
Connect "Windows 7 VM" // Connects, or switches the active connection, to a saved SUT in the Connection List with the name "Windows 7 VM"
Example (VNC):
Connect {serverID: "10.211.55.4", portNum: "5900", Visible: "Yes"} // Connects to a SUT using the specified IP and port number. When running the script in the GUI, the Visible property causes the Viewer window for the SUT to come to the front.
Example (by name with added property):
Connect {ServerID: "Samsung_S5", scaleRemoteScreen: "Yes"} // scaleRemoteScreen is an additional argument for Android and iOS SUTs only.
Example (handler):
// Define "ConnectRDP" command with parameters so it can connect to any desired RDP SUT using a screen resolution of 1920x1080.
// Example call: ConnectRDP "10.1.10.130", "password123", "Administrator".
to handle ConnectRDP SUTID, SUTPassword, SUTUsername
Connect {serverID: SUTID, portNum: 3389, password: SUTPassword, username: SUTUsername, Type:"RDP", Width: 1920, Height: 1080}
end ConnectRDP
Example (Sauce Labs device):
connect {type:"SauceLabs",
deviceName:"Samsung Galaxy S10",
platformName:"Android",
app: "",
userName: "Graham52",
apiKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
dataCenter: "us-west-1",
}
Example (Sauce Labs browser):
set SauceCredentials to {
userName:"RootieTootie",
apiKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
dataCenter: "us-west-1",
}
connect {type:"SauceLabs",
browserName:"Chrome",
platformName:"Windows 10",
url: "https://www.google.com",
} adding SauceCredentials
Example (Citrix):
connect {type:"Citrix",
storefrontURL:"https://citrix.yourorgscitrixdomain.com/Citrix/Citrix",
userName:"EggplantUser",
password:"NuggetsNation",
application:"Windows Server 2019",
screenResolution:"1600x900",
screenshotInterval:"400"
}
Example (Mobile Device - Android with automatic device detection):
connect {type:"Mobile Device",
name:"My Android Device",
deviceId:"Connected",
}
Example (Mobile Device - Android with emulator):
connect {type:"Mobile Device",
name:"My Android Device",
deviceId:"emulator-5554",
}
Example (Mobile Device - iOS with automatic device detection):
connect {type:"Mobile Device",
name:"My iOS Device",
deviceUDID:"Connected",
provisioningProfilePath: "/Users/janedoe/Documents/my-certs/my-provisioning-profile.mobileprovision",
developerCertificatePath: "/Users/janedoe/Documents/my-certs/my-developer-cert.p12",
developerCertificatePassword: "xxxxxxxxxx",
developerDiskPath: "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport",
}