Record a scenario log

You can record your interactions with a Genero application into a log file, which can then be used to generate a test scenario.

Take a snapshot

While recording your interactions, you can take a snapshot of the current application state with the ALT+F12 keyboard shortcut. The snapshot is recorded in the log as a log event. A log file can contain multiple snapshots; you can capture as many snapshots as needed.

Record a guilog log using a direct connection

About this task:

In this task the --start-guilog option of the fglrun command is used to record a log file. For more information on using this command, see the GUI front-end connection chapter of the Genero Business Development Language User Guide.

  1. Set the environment:

    Source and run the environment script (envcomp or envcomp.bat) in your FGLGWS installation.

  2. Launch the Genero Desktop Client.
  3. Start the application using fglrun and the --start-guilog option.
    For example:
    D:\fjs\gst\fgl\demo\Widgets>fglrun --start-guilog=D:/tmp/log/edit.log Edit
    In this example:
    • The DVM is run with the --start-guilog option to record a log file.
    • The interaction is saved to a file named edit.log.
    The GDC opens the application in a system window.
    Figure: Edit application

    Demo Edit application served by the GDC
  4. Use the application to execute some actions to record in the log.
  5. To finish recording, close the application.

When you have completed recording the log, your next task is to generate test sets from the recorded log file. See Generate a scenario from a log file.

Record a scenario log via the GAS (DVM)

About this task:

In this task you record a log from the DVM end by adding the fglrun --start-guilog command in the DVM element of the application configuration file. When the application is run, the specified guilog file is generated.

  1. Add a DVM element to the configuration file of your application.
    For example:
    <?xml version="1.0" encoding="UTF-8" ?>
    <APPLICATION Parent="defaultgwc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:noNamespaceSchemaLocation="https://4js.com/ns/gas/4.01/cfextwa.xsd">
     <EXECUTION>
        <PATH><path_to_your_application></PATH>
        <DVM>fglrun --start-guilog=/tmp/myapp.log</DVM>
        <MODULE>myapp</MODULE>
     </EXECUTION>
      <UA_OUTPUT>
        <PUBLIC_IMAGEPATH>$(res.public.resources)</PUBLIC_IMAGEPATH>
        <GBC>_default</GBC>
      </UA_OUTPUT>
    </APPLICATION>
    In this example:
    • The DVM is run with the --start-guilog option to record a log file.
    • The interaction with the application is saved to a file named myapp.log.
  2. Save the configuration file in the $(res.appdata.path)/app directory.
  3. Set the environment for the GAS
    Source and run the environment script (envas or envas.bat) in your GAS installation directory.
  4. Start the standalone dispatcher.
    httpdispatch &
  5. Run the application in your browser.
    In this example, the URL is looking for a configuration file named myapp.xcf:
    http://localhost:6394/ua/r/myapp

    As you interact with the application, all this activity is recorded in the file specified.

  6. To finish recording, close the application.
    Warning:

    Next time you run the application with this DVM configuration, the log file is overwritten.

When you have completed recording the log, your next task is to generate test sets from the recorded log file. See Generate a scenario from a log file.

Record a GDC log

Before you begin:

The Genero Desktop Client (GDC) records actions from all running applications in its log. The GGC generates test scenarios from this log. Therefore, you need to ensure the log only records actions from your test application.
Warning:

To avoid errors in the log caused by the GDC recording actions from other applications, it is highly recommended you close all applications running in the GDC before starting the recording for your test application.

For more information on GDC logging, see the Using the logging system page in the Genero Desktop Client User Guide.

About this task:
In this task you record a log from the GDC.
Important:
The beginning (starting the application) and ending (stopping the application) must be included in the recorded log in order for the GGC to have a complete session. Therefore, you need to perform the recording steps in this order:
  1. Start recording.
  2. Launch the application you want to test.
  3. Close the application before you stop the recording.
  1. Launch the Genero Desktop Client.
  2. Begin recording the GDC log file.
    1. In the GDC monitor, select the Debug panel
    2. In the File field, enter the path to the log file
      Note:

      If the file exists, it will be overwritten.

    3. Click Record
    Figure: Recording a GDC log

    Genero Desktop Client Debug panel showing how to record a log file
  3. Start the application using fglrun.
    For example:
    D:\fjs\gst\fgl\demo\Widgets>fglrun Edit
  4. Use the application to execute some actions to record in the log.
  5. When you are finished, close the application.
  6. To finish recording, click Stop

When you have completed recording the log, your next task is to generate test sets from the recorded log file. See Generate a scenario from a log file.

Record a GBC log

About this task:

The GGC can generate test scenarios from logs recorded by the Genero Browser Client. GBC version 1.00.53 or greater is required. In this task you record a log from the GBC. For more information, see the Record a GBC log page of the GBC documentation provided as part of the GBC project package.

  1. Set the environment for the GAS.
    Source and run the environment script (envas or envas.bat) in your GAS installation directory.
  2. Start the standalone dispatcher.
    httpdispatch &
  3. Run an application in your browser.
    In this example, the "price" application is launched with the recordGbcLog=1 string to set recording log mode. It records the session's interaction between the front-end and the DVM:
    http://localhost:6394/ua/r/price?recordGbcLog=1
    Figure: GBC log recording

    Screenshot of the GBC recording a log
    As you interact with the application, all this activity is recorded.
    Note:

    Notice the "Recording log ..." label in the application title bar.

  4. To stop the recording, close the application:
    When you close the application, the end page displays, with a link to "Get the GBC logs". Click on this link and follow the instructions in the system window that opens to download the session log.

    A GBC log file has a name like price-e798a311.gbclog. It takes the format of the app_name followed by a hyphen (-), part of the session_id, and the gbclog extension.

    The log is downloaded to your downloads directory.

When you have completed recording the log, your next task is to generate test sets from the recorded log file. See Generate a scenario from a log file.