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 FGLGWS environment.

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

  2. Build the sample application:
    Tip:

    The compiled price application (price.42m) is provided. Unless changes have been made, you can skip this step.

    • UNIX® like OS: Navigate to the quick-start directory and run the build script.
      cd ${GGCDIR}/src/quick-start
      bash build.sh
    • Windows®: You may have to copy the quick-start directory to a writable location before running the build script.
      xcopy /S "%GGCDIR%\src\quick-start" C:\tmp\quick-start
      cd C:\tmp\quick-start
      build.bat

    The price application is now compiled.

  3. Start the GDC.
    Launch the GDC monitor from the shortcut on the Start Menu (Windows). For more details for your OS, see the Genero Desktop Client User Guide.
    The GDC launches and you see the monitor screen.
  4. 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.
  5. 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.

  6. Compile the scenario.
    fglcomp price_sample.4gl
    The generated test scenario compiles and creates the application file price_sample.42m.
  7. 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


    Note:

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

Run the test scenario with the application running on the GAS

Before you begin

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, run the build script described in Step 2.

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 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.
  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. 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.