Previous Topic: CA Application Test TutorialsNext Topic: Tutorial 2 - Data Sets


Tutorial 1 - Projects, Test Cases, and Properties

Tutorial Tasks

In this tutorial, you:

Prerequisites

Step 1 - Start DevTest Workstation

Follow these steps:

  1. Start the registry.
    1. Start the registry by clicking Start Menu, All Programs, DevTest Solutions, EnterpriseDashboard. Wait until the "Enterprise Dashboard started" message appears.
    2. Start the registry by clicking Start Menu, All Programs, DevTest Solutions, Registry.
  2. Click Start, All Programs, DevTest Solutions, Workstation.
  3. When the Set DevTest Registry dialog opens, select a registry and click OK.
  4. The Login dialog opens. Enter a valid username and password and click Login.

Step 2 - Create a Project

The project that you create holds all the test case example files that are required for the tutorials.

Follow these steps:

  1. From the DevTest Workstation main menu, select File, New, Project.

    The Create New Project dialog opens.

  2. In the Project Name field, remove the default value and type My Tutorials.
  3. Click Create.

    The My Tutorials project is created.

Step 3 - Create a Test Case

A test case is a specification of how to test a business component in the system under test.

Follow these steps:

  1. In the Project panel, right-click the Tests folder and select Create New Test Case.
  2. Set the file name to tutorial1.
  3. Click Save.

    DevTest Workstation opens a new tab labeled tutorial1. The green arrow in the model editor represents the start of the test case.

Step 4 - Add a Property to the Project Configuration

In this step, you set a global property in the project configuration. You access this property later in the tutorial.

The default configuration has the name project.config, and is created automatically for a new project. The project.config file is located in the Configs folder in the Project panel. The file extension is not shown. You can add the properties to the project.config file and, if necessary can also create a configuration file.

Follow these steps:

  1. In the Project panel, double-click project in the My Tutorials > Configs folder.

    The properties editor opens.

  2. To add a row, click LISA-- icon_image_whiteplussign Add at the bottom of the properties editor.
  3. In the Key field, type config_prop.
  4. In the Value field, type 42.
  5. From the main toolbar, click Main Toolbar Save icon Save.

Step 5 - Add a Test Step

A test case includes one or more test steps. In this procedure, you add an Output Log Message test step to write text to the log file.

Follow these steps:

  1. Click the tutorial1 tab.
  2. Click LISA--icon_image_whiteplussignbluecircle Add Step, select Utilities, and select Output Log Message.

    A step named Output Log Message is added to the model editor.

  3. Right-click the Output Log Message step and select Rename.
  4. Change the name to My Output Log Message.
  5. Make sure that My Output Log Message is still selected. In the right pane, click the arrow next to Output Log Message.

    The Output Log Message tray opens.

Step 6 - Add a Log Message

With the log editor open, you add a log message that includes various properties.

The properties in the log message originate from several sources:

The syntax for a property is {{property_name}}.

Follow these steps:

  1. In the log editor, delete the placeholder text.
  2. Copy and paste the following text into the log editor:
    The LISA home directory is: {{LISA_HOME}}. LISA sets this property.
    The value of config_prop is: {{config_prop}}. We set this property in the configuration.
    The version of Java being used is: {{java.version}}. This is a system property.
    The new value of config_prop is: {{config_prop=21}}. We changed the value of config_prop here in log message itself.
    Adding 1 to config_prop gives: {{config_prop}} + 1. We did not change the value of config_prop.
    Create a new property named MyOutputLogMessage_step_prop: {{MyOutputLogMessage_step_prop=100}}.
    The MyOutputLogMessage_step_prop property has been assigned the value 100.
    

    The log editor looks like the following graphic.

    Output Log Message example for Tutorial 1

Step 7 - Add a Second Log Message

The second test step in the test case writes a different message to the log file.

Follow these steps:

  1. Close the first log message step by clicking the arrow at the upper left corner of the window.
  2. Click LISA--icon_image_whiteplussignbluecircle Add Step, select Utilities, and select Output Log Message.

    A step with the name Output Log Message is added to the model editor and the Output Log Message tray opens.

  3. In the log editor, delete the placeholder text.
  4. Copy and paste the following text into the log editor:
    The current value of config_prop is: {{config_prop}}.
    The current value of MyOutputLogMessage_step_prop: {{MyOutputLogMessage_step_prop}}.
    

    Note: The log message does not change the values of config_prop or MyOutputLogMessage_step_prop.

  5. Close the second log message step by clicking the arrow at the upper left corner of the window.
  6. From the main application toolbar, click SaveMain Toolbar Save icon, or select File, Save, tutorial1.

Step 8 - Run the My Output Log Message Step

The Interactive Test Run (ITR) utility enables you to walk through and verify a test case.

Follow these steps:

  1. From the toolbar, click the Blue Gear Icon Start ITR.

    The ITR opens. The ITR contains an Execution History pane on the left and a set of tabs on the right.

  2. In the Execution History pane, click LISA--icon_image_rightarrowtolineingreencircle Execute Next Step.

    The My Output Log Message step is run. The Response tab displays the response from the My Output Log Message step. The actual values replace the properties.

Step 9 - Observe Property Values

The ITR also lets you observe how the properties are created and modified.

Follow these steps:

  1. Click the Properties tab in the ITR.

    The Properties tab displays the value of each property before and after the execution of the My Output LogMessage step. A value that the step created is highlighted in green. A value that was modified in the step is highlighted in yellow. Notice that the value of config_prop was changed from 42 to 21.

  2. Compare these values with the response in Step 8.

Step 10 - Run the Output Log Message Step

In this procedure, you use the ITR to run the second step in the test case.

Follow these steps:

  1. In the ITR, click LISA--icon_image_rightarrowtolineingreencircle Execute Next Step to run the Output Log Message step.
  2. To view the response, click the Response tab. Although you set config_prop to 42 in the project.config file, you changed the value to 21 in the My Output Log Message step, and the value did not change in the Output Log Message step. The value of the MyOutputLogMessage_step_prop property also carried over from the My Output Log Message step to the Output Log Message step.
  3. To view the current and previous property values, click the Properties tab.
  4. When you are done, close the tutorial1 and project tabs.

Review

In this tutorial, you took a first look at properties. You saw that properties are denoted by using a special syntax, {{property_name}}. You can set properties by using a variation of this syntax; {{property_name=value}}. After you set a property, use or modify it in subsequent steps in a test case.

In this tutorial, you: