Quick Start: Generate and execute a test scenario

With this quick start, you will prepare your environment, compile a simple application, record a guilog, generate a test scenario from the guilog file, and execute the test scenario.

In working with this quick start, you will get an understanding of Genero Ghost client basics and you see how you can use it for testing scenarios using your Genero BDL applications. Two procedures are provided: running a test scenario that uses a direct connection to the Dynamic Virtual Machine (DVM), and running a test scenario that uses an application running on the Genero Application Server (GAS).

Run a test scenario using a direct connection

Steps

  1. Set the GGC environment.
    Run the envggc script (($GGCDIR/envggc or %GGCDIR%/envggc.bat) for your GGC installation.
  2. Set the FGLGWS environment.

    Run the envcomp script ($FGLDIR/envcomp or %FGLDIR%/envcomp.bat) for your FGLGWS installation.

  3. Prepare the sample application by compiling the libraries, changing the binaries permissions (for Unix-like systems) and compiling the sample application.
    • UNIX® like OS: Navigate to the $GGCDIR and run the build script.
      cd ${GGCDIR}
      bash build.sh
    • Windows®: You may have to copy the quick-start directory to a writable location before running the build script.
      cd %GGCDIR%
      build.bat

    The sample price application is now compiled.

  4. Start the Genero Desktop Client.
    For OS-specific instructions on starting the Genero Desktop Client, see the Genero Desktop Client User Guide.
    The Genero Desktop Client launches and you see the monitor screen.
  5. Record a GUI log.
    1. Run the price application using one of the following sets of commands.
      • UNIX like OS:
        cd ${GGCDIR}/src/quick-start
        export FGLIMAGEPATH=${GGCDIR}/src/quick-start/img:${FGLDIR}/lib/image2font.txt
        fglrun --start-guilog=price_sample.guilog price
      • Windows:
        cd %GGCDIR%\src\quick-start
        set FGLIMAGEPATH=%GGCDIR%\src\quick-start\img;%FGLDIR%\lib\image2font.txt
        fglrun --start-guilog=price_sample.guilog price
      The GDC opens the application in a system window.
      Figure: Price application run by GDC

      Price application running in GDC
    2. Execute some actions to record in the log, then close the application.

      For example, you can sort on the Product name or Price columns, and you can edit the price of items.

    The DVM generates the price_sample.guilog file.
  6. Generate a scenario from the guilog file.

    The ggcgen bdl command transforms a DVM guilog into a BDL scenario.

    ggcgen bdl price_sample.guilog

    The file price_sample.4gl is the created test scenario.

  7. Compile the scenario.
    fglcomp price_sample.4gl
    The generated test scenario compiles and creates the application file price_sample.42m.
  8. Start the GGC server.
    Before you execute a test scenario, you must start the GGC server. To continue in the same terminal window, you must run the command in the background; alternatively, you can open a second command prompt to start the GGC server from.
    • UNIX like OS:
      ggcadmin startbdlserver &
    • Windows: Use "start /min" to have the command run in a new, minimized window:
      start /min ggcadmin startbdlserver
  9. Type the following command to run the test:
    fglrun price_sample tcp --command-line "fglrun price"

    Where the path to the test application (price_sample) and the application being tested (price) is the current working directory.

    The test runs, and the results display in the output.
    Figure: Output for the TCP test scenario (Windows)


    Note:

    The output is intended as a sample to show test session statistics, the format may change in future product releases.

  10. With the test scenario complete, stop the GGC server.
    ggcadmin stopbdlserver

Run the test scenario with the application running on the GAS

Before you begin

This procedure assumes you completed the previous quick start, Run a test scenario using a direct connection.

You should have a Genero Archive file, ggc-quick-start.gar, in your $GGCDIR/src/quick-start directory. If you do not find this file, return to that procedure and complete its steps.

This procedure uses the test scenario generated in the procedure Run a test scenario using a direct connection. If you do not have generated the price_sample test scenario, return to that procedure and complete its steps.

This procedure requires two command line windows.

Steps

  1. In your first command line window, set the environment for both FGLGWS and the GAS.
    Run the envcomp script ($FGLDIR/envcomp or %FGLDIR%/envcomp.bat) for your FGLGWS installation.
    Run the envas script ($FGLASDIR/envas or %FGLASDIR%/envas.bat) for your GAS installation.
  2. Start the standalone dispatcher.
    httpdispatch &
  3. In your second command line window, set the environment for FGLGWS, GAS, and GGC.
    Run the envcomp script ($FGLDIR/envcomp or %FGLDIR%/envcomp.bat) for your FGLGWS installation.
    Run the envas script ($FGLASDIR/envas or %FGLASDIR%/envas.bat) for your GAS installation.
    Run the envggc script ($GGCDIR/envggc or %GGCDIR%/envggc.bat) for your GAS installation.
  4. Deploy the quick-start archive.
    Navigate to the quick-start directory and deploy the quick-start archive with the following gasadmin command:
    gasadmin gar --deploy-archive ggc-quick-start.gar
    A successful deployment returns this output (output may differ slightly depending on the platform).
    Archive ggc-quick-start.gar successfully deployed.
    Note:

    These instructions use the gasadmin command. If you have configured your GAS for the Deployment Application, you can use it instead. See the Genero Application Server User Guide for information on using the Deployment Application.

  5. Enable the quick-start archive.
    From the quick-start directory, run the following gasadmin command:
    gasadmin gar --enable-archive ggc-quick-start.gar
    If the archive is enabled, the following output is displayed (output may differ slightly depending on the platform):
    Archive ggc-quick-start.gar successfully enabled.
  6. Ensure the application works correctly.
    In a browser type the address:
    http://localhost:6394/ua/r/price
    You should see the "Product and prices" application open in your browser and be able to interact with it.
  7. Start the GGC server.
    Before you execute a test scenario, you must start the GGC server. To continue in the same terminal window, you must run the command in the background; alternatively, you can open a second command prompt to start the GGC server from.
    • UNIX like OS:
      ggcadmin startbdlserver &
    • Windows: Use "start /min" to have the command run in a new, minimized window:
      start /min ggcadmin startbdlserver
  8. Execute the compiled test scenario against the application running on the GAS.
    fglrun price_sample.42m ua --url http://localhost:6394/ua/r/price
    The test runs, and the results display in the output.
    Figure: Output for the TCP test scenario


    Note:

    The output is intended as a sample to show test session statistics, the format may change in future product releases.

  9. With the test scenario complete, stop the GGC server.
    ggcadmin stopbdlserver