Single Machine Testing
There are a few ways of circumventing this, if using two systems presents a problem for your team. Options include:
- Using a Virtual Machine as your SUT *Recommended*
- Using Fast-User Switching on Mac
- Using the Eggplant Functional Machine Only *This provides limited functionality*
Using a Virtual Machine
Virtual machines allow you to use Eggplant Functional with its intended architecture, with a desktop machine hosting Eggplant Functional, and a virtual machine acting as the SUT.
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.
Using Fast-User Switching on Mac
As long as you are running Eggplant Functional on a Mac OS X (10.4 or later) machine you can author and test on the same computer using fast-user switching. One user will act as the Eggplant Functional machine, and another will act as the SUT.
Step by Step: Using Fast-User Switching to Create a SUT
Once you have Eggplant Functional installed and running, you should:
- Install Vine Server on the local machine.
- Enable fast user switching. This can be done by going to System Preferences > Users & Groups > Login Options.
- Allocate a user account as the test account. If you do not have another user on the local machine then create one.
- Using System Preferences, add Vine Server as a Login Item for the test account.
- Close System Preferences.
- Switch over to the test account by clicking on the current user’s name in the upper right corner of the screen.
- From the test account you should notice that Vine Server starts as soon as you login.
- Switch back to the account that you were logged in as: the main account that you normally run Eggplant Functional from.
- In Eggplant Functional, establish a connection to the VNC server which should show up under Bonjour servers in the list of available connections (or else via IP address of the local machine or via “your_Machine_name_here”.local).
By this time you should be able to see the desktop of the other user’s account, and you should be able to author scripts just like you would had Eggplant Functional been connected to a separate machine. If you are experiencing a repeated window/mirror effect then make sure that you are not connecting to an instance of the VNC server running on the same user account that is running Eggplant Functional.
Using the Eggplant Functional Machine Only
Eggplant Functional uses a two-system model, but under certain conditions it can also be set up using a single system model.
Why Run on a Single System?
This approach is usually used when one person has already developed scripts using the two-system approach with a development license, and another member of the team would like to run the scripts but does not have a separate machine to use as a SUT.
If a user is working remotely and needs to run a script, but doesn't have access to a VM or physical machine, they can run from the command line on their own machine by following these instructions.
Requirements
In order for this to work, you will need to use Eggplant Functional via Command Line and you will not be able to access the Eggplant Functional interface. If Eggplant Functional is run in GUI mode on the same machine, it will generate a “Hall of Mirrors” effect, as the application will VNC into the same system and will be looking at itself.
Step by Step: Running Eggplant Functional on a Single System
- For this process, you must run Eggplant Functional scripts via the command line. For instructions about how to run via command line on Mac, Windows, or Linux, see Running from the Command Line.
- When you are prompted to enter the Connection Information of the SUT (as when using the two-system model), use the connection information of localhost instead, as shown in the example below. The key difference is to connect into your local machine instead of a remote SUT.
Example:
"C:\Users\Abhijith>"C:\Program Files (x86)\eggPlant\runscript.bat" "C:\Users\Abhijith\Web4.suite\Scripts\Win7crossbrowser.script" -host localhost -port 5901
Passing Parameters
You can pass parameters to a single script or the last of multiple scripts to be run. At the end of the runscript call, type -params, and then the parameters, separated by spaces. In the example below, the parameters are different browsers to be tested.
Example:
"C:\Users\Abhijith>"C:\Program Files (x86)\eggPlant\runscript.bat" "C:\Users\Abhijith\Web4.suite\Scripts\Win7crossbrowser.script" -host localhost -port 5901 –params "Chrome" "Safari" "Firefox" "Opera"