Executing scripts from Other Systems

A script can be copied to and played back from systems other than the one on which it was developed. Prior to copying, ensure the following:

  1. CitraTest’s Runtime environment will have to be installed on the system from which the script is to be played back
  2. The script, when executed, should be able to connect to the application to be monitored. For example, if the CitrixEx script that we built earlier is to be copied and run from another system, then such a system should host the Citrix ICA Client, and a shortcut to it should be available on the system’s desktop.
  3. As mentioned previously, CitraTest employs image-recognition and text-recognition techniques to perform script playback. Therefore, the images that will be used by the script during playback, should, in appearance (shape, size, label, etc.), be the same as the ones that were captured. Only then will the script be able to recognize the images and act as instructed. For example, say that a script has been built to connect to the Internet Explorer by clicking on the Internet Explorer shortcut on the Windows Desktop. Assume that the whole of this shortcut was captured as an image during script development. If the label of this shortcut is changed to IE in the system on which the script is to be played back, then playback will fail.
  1. The first step towards playing back scripts from other systems is to bundle the script’s dll and exe files into a distributable package. This can be done using the Package and Deployment Wizard on the system on which the script was developed. To bundle the required files for the CitrixEx project in our example, do the following:

    1. Start the Package & Deployment Wizard using the menu sequence depicted by Figure 1.

      Figure 1 : Starting the Package and Deployment Wizard

    2. Next, select or specify the complete path to the project (.vbp file) that needs to be packaged. Figure 2 reveals that the CitrixEx project is being packaged.

      Figure 2 : Specifying the path to the project to be packaged

    3. Next, click on the Package button in Figure 2 to bundle the CitrixEx into a distributable package.
    4. The default Packaging script is Standard Setup Package 1 (see Figure 3). Leave it as is and click the Next > button to proceed with the packaging.

      Figure 3 : Choosing a packaging script

    5. Next, select Standard Setup Package (see Figure 4) as the type of package to be created, and click on the Next > button to proceed.

      Figure 4 : Selecting the type of package

    6. Specify the path to the folder where the package will be assembled (see Figure 5). Note that, for our example, a folder named Package has been created for this purpose. The path to the Package folder has been provided in Figure 5.

      Figure 5 : Specifying the location where the package will be assembled

    7. While the packaging is in progress, you might receive an error message depicted by Figure 6. This error will not hamper the packaging process or its output. Therefore, ignore it by clicking on the ok button (see Figure 6).

      Figure 6 : Error message

    8. Next, Figure 7 will appear listing all the files (dll’s and exe’s) that have been included in the package. To add more files to the list, click on the Add button therein. Since our CitrixEx package does not include additional files, simply click the Next > button to proceed.

      Figure 7 : Files that form part of the package

    9. You can create one large cab file or multiple cab files for a package. For our example however, choose the Single cab option, and click the Next > button to proceed (see Figure 8).

      Figure 8 : Indicating the number of cab files to be created

    10. The package will consist of a Setup.exe, which when executed on the system on which the script needs to be played back, copies the bundled dll’s and exe’s to that system. In Figure 9 therefore, specify the title to be displayed when the Setup.exe is run on the destination system. Then, click the Next > button to continue.

      Figure 9 : Entering the title of the setup program

    11. You can change the location to which the bundled dll’s and exe’s are to be copied by modifying the macros displayed in the Install Location column of Figure 10. Then, click the Next > button to continue.

      Figure 10 : hanging the install location of the dll’s and exe’s

    12. Using Figure 11 that appears next, indicate whether the listed files are to be installed as shared files or not. If a file is to be shared by another program, indicate the same by selecting the check box against the file name in Figure 11. As the displayed CitrixEx.exe file need not be installed as a shared file, simply click the Next > button to proceed with the setup.

      Figure 11 : Indicating whether files are to be installed as shared files or not

    13. Once the wizard is through with the process of collecting the information to build the package, it will request you to provide a name under which the specified configurations need to be saved (see Figure 12). Then, click the Finish button.

      Figure 12 : Saving the session

    14. Upon clicking the Finish button, Figure 13 will appear, wherein you will have to click the Close button to complete the process.

      Figure 13 : Closing the packaging process

    15. If you can recall, in our example, a folder called Package was created, where the package will be assembled at the end of the packaging process (step ‘f’). Figure 14 allows you a peek into the Package folder, soon after the completion of the packaging process.

      Figure 14 : The contents of the Package folder

    16. The CitrixEx winzip file of Figure 158 consists of all the important dll’s and exe’s that will have to be copied to the destination system. The setup application is the executable that will have to be run on the destination system to facilitate the copying.
  1. Next, you need to manually copy a few files from the VB project directory in the source system to some location in the destination system. For our example, the following files have to be copied:
  2. Then, proceed to execute the Setup.exe on the destination system to copy the bundled exe’s and dll’s. To achieve this, do the following:

    • The Images folder
    • The Package folder
    • The CitrixEx Application
    • CitrixEx.bas
    • CitrixEx.vbp
    • CitrixEx.script
    1. Open the Windows Explorer in the destination system and navigate to the system which hosts the packaged project.
    2. From the directory in the source system that contains the packaged project, run Setup.exe.
    3. The Welcome screen of the setup program will then appear. Note that the title that we had provided earlier (CitrixEx) appears here (see Figure 15).

      Figure 15 : Welcome screen of the package installation program

    4. Next, provide the directory in which the CitrixEx installation has to be saved, and then, click the button at the top of Figure 16 to begin installing it.

      Figure 16 : Commencing installation of the software

    5. Setup will then provide you with the option to add a group for the project to the Programs group of the Start menu. Then, click the Continue button.

      Figure 17 : Adding a new group to the Programs group

    6. Upon completion of setup Figure 18 will appear. Click the ok button to close the message box.

      Figure 18 : Message on completion of setup

    7. With that, setup is complete. You can later verify whether the packaged dll’s and exe’s have been installed to the locations specified while packaging.
  3. Since the location of a few key directories would have changed while copying them from the source to the destination system, you need to update the CitrixEx.script file with the corresponding changes. To achieve this, open the CitrixEx.script directory that was manually copied to the destination system, and make the required changes to the imagepath, searchpath, and fontpath parameters (see Figure 19). The parameters that need to be changed.

    Figure 19 : Change the image, search, and font paths

    The Fonts directory will typically exist in the install directory of the CitraTest Runtime environment.

  4. Finally, execute the CitrixEx application that was manually copied to the destination system to playback the script.