Use EyeStudio or a normal text editor to edit the scripts. Specify one command on each row in a script. A command may take one or more command parameters separated by spaces. Place quotes around parameters that contain spaces:
Type “This is a test”
Select a command in EyeStudio and press the F1 key for context sensitive help.
A script in EyeAutomate is visually readable and consists of commands, images, data and widgets.
A visual script may consist of four types of files:
Example of a visual script:
A bundle is a zip file, with an “.eye” extension, that contains everything needed for a visual script to run. A bundle contains scripts, images, data, widgets and commands.
Note that a bundle also contains the commands needed to run the script to make it really easy to move a script from one installation to another.
A typical scenario is to develop the bundle on one machine and use another machine for running the bundle periodically or on demand.
Note that you may rename (to “.zip”) and extract the bundle using unzip.
Images are used by many of the commands to find something on the screen instead of specifying the exact coordinates. Images are captured with the Recorder or using the Insert / Image button in EyeStudio.
Images will work even if there are only portions that actually matches some part of the screen. The Vizion Engine focuses on the similarities rather than the differences between the actual and recorded appearance.
The target location, marked by a circle, is in the center of the image, by default. The target location is more important than the boundaries.
Change the target location by selecting another target location within the image using the Properties dialog. Click on an image to open the Properties dialog.
Use a target area if you get an incorrect result when using a target location. Click on an image and use the Properties dialog to place the selection rectangle around the target area. The target area will be matched in detail (95% correct, by default) while the rest on the image will be verified in less detail (30% correct, by default).
A Click command will click in the center of the target area.
Use larger images since they contain more information in order to find the right match. Make sure to specify a target location or area within the image.
Using a target area is very important in combination with the Search command to avoid finding something similar before finding the actual image. You may also avoid an incorrect match by increasing the ConfirmationLevel.
Image paths can be either relative or absolute. Relative paths are, by default, relative to the EyeAutomate installation folder (that contains the “EyeAutomate.jar” file), for example:
"images/1339591239425.png".
An absolute path is platform dependent and might look something like:
"C:\EyeStudio\images\51339591239425.png".
Scripts, images, data and widgets are, by default, stored in the “scripts”, “images”, “data” and “widgets” folders located in the EyeAutomate installation folder.
Use the built-in parameters “ImageFolder” or “ScriptFolder” to make it easier to locate and switch between images or to make relative Calls to other scripts.
Images are, by default, placed in the “images” folder. The “ImageFolder” parameter points to this folder, by default, and the recorder adds this parameter to any new image path created to make it easy to switch image folder. Changing the “ImageFolder” parameter will also change the default location of new images. For example: “{ImageFolder}/1339591239425.png”.
You may modify the RootFolder using the Settings/Set Image Folder option in EyeStudio.
The “ScriptFolder” parameter contains a relative or absolute path to the folder of the current script. Use the “ScriptFolder” parameter to refer to scripts or images located in the same or in a folder below the current script. For example: “{ScriptFolder}/images/1339591239425.png”.
Use the “RootFolder” parameter in the “parameter.properties” file to select another root folder for the “scripts”, “images”, “data” and “widgets” folders. This can be valuable when using an external version handling system. Add, for example, the line below to the “parameter.properties” file:
RootFolder=C\:/EyeAutomateData
You may also modify the RootFolder using the Settings/Set Root Folder option in EyeStudio.
Note that you need to escape the colon with a backslash in the Java properties file!
Move the “scripts”, “images”, “data” and “widgets” folders from the EyeAutomate installation to the new root folder “EyeAutomateData” so that you get the folder structure below:
Widgets makes it easier to maintain targets in the user interface. A Widget is a small script that contains a prioritized list of Properties. A Property can be an image, a location or an identifier that can be used to locate a target. The Widget script is executed one command at a time until a command finds a target location. The script execution will not stop even if a command fails.
Example of a script that uses two Widgets:
The Eye finds the best visible match. If there are several identical matches it will return them in order of distance from the current location. The current location is in the upper-left corner of your desktop from the beginning.
Many commands in EyeAutomate can take a text instead of an image as a parameter. The current font setting is used when creating an image from the provided text. See the Font command for details about how to change the current font.
A visual script can be divided into Steps. There are mainly two reasons for dividing a script into Steps:
To make the script easier to read and understand.
To turn an automatic script into a semi-automatic script.
A step begins with a Begin command and ends with an End command. Steps can be nested to form a hierarchy. A step description may consist of both text and images.
Steps can be created before or after creating a script. Creating a number of steps before creating a script is useful when preparing the outline for a semi-automatic script.
A script containing one or several empty steps can be run just like a script that contains commands only. An empty step will behave like a manual test instruction.
Select some commands and use the Insert / Step button to turn the selected commands into a Step. Enter a step description and select the OK button.
Parameters can be used to make a script more reusable. Parameters are enclosed in brackets and are case sensitive, for example: {delay}. EyeStudio will automatically ask the user to provide a value for an undefined parameter after pressing the Run button. Parameters can be passed from one script to another using the Call command. A parameter may also be assigned a value using the Set command.
Parameters are inherited from a calling script to a called script. Parameters that are defined or modified by a called script are not visible to the calling script.
There are built-in parameters that are set by EyeAutomate during script execution. Built-in parameters are listed in the table below:
Parameter |
Description |
CurrentX |
The last X-coordinate set by the MouseMove or WaitMouseMove commands. Useful for moving one coordinate only. |
CurrentY |
The last Y-coordinate set by the MouseMove or WaitMouseMove commands. Useful for moving one coordinate only. |
ImageFolder |
The image folder used by EyeStudio, default set to “images”. Change image folder used by the editor using the Set image folder option in the Settings menu. |
ManualTestResult |
The entered Result from the Manual Test Dialog. |
ScriptFolder |
The absolute or relative path to the folder of the current script. |
The “parameter.properties” file contains the ImageFolder parameter, the RootFolder parameter and user defined parameters inherited by all scripts.
Example of a “parameter.properties” file:
RootFolder=C\:/EyeAutomateData MyFolder=Test ImageFolder=images
Note that you need to escape a colon with a backslash in the Java properties file. Also use forward slashes instead of backslashes in a Java properties file.
Use the Settings \ Set Parameter option in EyeStudio to insert or modify a parameter in the parameter properties file.
Use a data (CSV – Comma Separated Values) file to pass parameters to the script. This makes data-driven testing possible. Specify one parameter per column in the data(csv) file. The script will be executed one time for each row in the data(csv) file.
Specify the parameter names in the first line of the data(csv) file. Parameter names are case sensitive. You may use any common (like comma, TAB, colon, pipe, semicolon) column delimiter; EyeAutomate will automatically detect the delimiter used.
Run a script given a data file using the Run with Data File option in the Script menu.
Data File Example:
LoginId Password MenuItem Tom Secret File Erica Secret Edit