Connecting to the Same System (Single System Testing)
There are a few different ways you can use Eggplant Functional (EPF) to conduct tests using a single machine. Even though the original design was a two-system model, you can run Eggplant Functional in a single-system model, with the Eggplant Functional controller and your SUT on the same machine.
Eggplant Functional was originally designed to run as a two-system model, where Eggplant Functional runs on one machine, sometimes called the "Eggplant machine" or "Eggplant Functional controller," and drives tests on a second machine, called the "system under test" (SUT).
Following is a description of why you might want to test with Eggplant Functional in a single-system model and how it works.
Why Run on a Single System?
Runnning Eggplant Functional in a single-system model provides several benefits, including the following:
- You can automate tests on your own machine
- You do not need a second machine
- You do not need to open any ports on your machine
- You are not vulnerable to SUT disconnections due to network disruptions
Methods for Single-System Testing
Eggplant Functional supports the following methods for single-system testing:
- Using the Eggplant Functional machine only (without VMs)
- Using a virtual machine (VM) as your SUT on the same machine with Eggplant Functional (Recommended for advanced users)
Using the Eggplant Functional Machine Only (Without VMs)
It is possible to conduct single-system testing on the physical machine where you are running Eggplant Functional without using Virtual Machines (VMs):
- On Windows, using the Single System SUT connection type available in the Eggplant Functional Connection List to connect to a child session on the same machine.
- On Mac, using a different user account with the VNC SUT connection type available in the Connection List to connect to different user session on the same machine.
For information on using VMs see Using a Virtual Machine (VM) as your SUT on the Same Machine with Eggplant Functional.
Using the Single System Connection Type in Eggplant Functional (Windows Only)
Support for this connection type was added in Eggplant Functional 23.3.0 for Windows only.
To use the Eggplant Functional Single System connection type, you must create a new connection in the Eggplant Functional Connection List and choose Single System for the Connection Type option. See Connecting to SUTs and Single System Specific Options for detailed instructions about this connection type.
Two important things to be aware of when you use Single System SUTs:
-
You must create, save, and modify all Eggplant Functional Single System type connections through the Connection List. You cannot create this type of connection as a temporary connection during a script run.
-
Even though the Single System SUT is running as a child process on your Eggplant Functional host machine, it is still using the same operating system. Any operating system-level failures could impact both the SUT and the host operating system.
When you establish a connection with an Eggplant Functional Single System SUT, Eggplant Functional connects to a picture-in-picture child session in the Windows system where you are running Eggplant Functional. The desktop of the child session displays in the Eggplant Functional Viewer window. You will see your Eggplant Functional desktop shortcut, or any other application shortcuts on the desktop with it, in the SUT Viewer even though they are running in a separate "parent" session. The two sessions are isolated to the extent that you can interact with SUT through the Viewer window, like it is a completely separate machine. For example, you can download and launch applications, and run tests like you would in a two-system model. However, they are still using the same operating system and both systems could potentially be affected by failures.
Some applications will not run simultaneously in both the parent session where Eggplant Functional is running and the child session opened by your Single System SUT connection. For example, the Chrome browser will not run in both sessions at the same time. If you want to use an application with this restriction in your tests, verify the application is not running in the session where Eggplant Functional is running and open it in the SUT Viewer window (child session). For example, if you need Chrome for one of your tests, close it on the desktop where your Eggplant Functional is running and open it on the SUT.
Connecting using the Eggplant Functional Connection List
Because Single System connections connect to a child session on your Eggplant Functional host machine, they use your same Windows credentials on that machine. We recommend enabling secure connections in Eggplant Functional and using the Windows Credential Manager to manage your user name and password for these connections. See Secure SUT Connection Credentials information about implementing secure credential management in Eggplant Functional.
As stated above, you must create Single System connections through the Connection List. See Step by Step: Entering Single System Connection Details on the Connection List page for informtion about creating Single System connections and establishing connections with them.
Connecting from a Script using SenseTalk
During test runs, you can connect to or switch to (activate) an existing Single System SUT connection by passing its name with the connect
command in your test scripts.
For example:
connect 'mySUT'
The Single System SUT connection must exist in the Connection List before you can use it in a script. You cannot use the connect
command to create a temporary Single System SUT connection and then use it during a script run.
Using a Different User Account and a VNC Connection Type (Mac Only)
To use single-system connections on a Mac, you can create a different user account on the machine and then create a VNC-type connection in the Eggplant Functional Connection List, specifying the user and password for that account in your VNC connection.
Step by Step: Single System Connection on Mac with a Second User Account
- Create a new user account on the Mac from Apple > System Settings > Users & Groups.
- Go to Apple > System Settings > Sharing > Remote Management.
- Enable Remote Management: On and VNC viewers may control screen with password. Set a VNC password.
- Go to Eggplant Functional > Connection > Connection List and create a VNC connection with server: localhost, using the password set in the previous step, and the default VNC port.
- Connecting to this SUT will display the login screen of the Mac. Enter the username and the password of the user created in step 1. Log in.
- Use the Eggplant Functional Viewer window to create / modify / run a SenseTalk script. At the end, log off the user from the Eggplant Functional Viewer window / the VNC session. Just disconnecting the VNC session won’t log off the user and won’t allow another connection to that user.
This approach allows a user to create and run scripts in the same way as if using a separate machine as a SUT. It uses the built-in VNC server on the Mac. It seems to be slower than other VNC servers and we have seen some problems with displaying drop-down lists.
Using a Virtual Machine (VM) as your SUT on the Same Machine with Eggplant Functional
Virtual machines allow you to use Eggplant Functional in its intended two-system model, with a desktop machine hosting Eggplant Functional, and a virtual machine acting as the SUT. This single-system option is recommended for advanced Eggplant Functional users who are familiar with running VMs.
Virtual machines, for those unfamiliar, are a way to run an operating system within a window, sharing resources with the host system. They provide a cost-effective way of hosting multiple operating systems on the same hardware.
Since a virtual machine behaves as an individual machine, you can use this as a SUT with Eggplant Functional. To set up a virtual machine, you can choose from a variety of virtual machine hosting products, which include VMWare, Parallels, and VirtualBox.
Regardless of which option you choose, the method of installation is the same. You will need an installation disk or disk image for the operating system you want to install.
Step by Step: Using a Virtual Machine as a SUT
- Download/Install the virtual machine product you choose.
- After you’ve installed, create a new virtual machine.
- The system will prompt you to enter settings for that machine, such as disk size, ram, etc.
- Once you’ve created the new machine, boot it up, and install a VNC Server on the virtual machine, noting it’s IP Address. For further information, see VNC Servers.
- Open Eggplant Functional, and add the new virtual machine to your connection list. Treat it as any other machine you wish to test against.
The host operating system needs to be the Eggplant Functional controller, and the virtual machine needs to be the SUT. Otherwise, you will get a “hall of mirrors” effect as VNC will be looking at itself.