Getting Started › CA Application Test Tutorials › Tutorial 1 - Projects, Test Cases, and Properties
Tutorial 1 - Projects, Test Cases, and Properties
Tutorial Tasks
In this tutorial, you:
- Create a project
- Create a test case
- Add properties
- Add simple test steps
- Use the Interactive Test Run Utility
Prerequisites
- DevTest Workstation is installed and DevTest license credentials are entered.
- You have reviewed the Glossary of Terms.
Step 1 - Start DevTest Workstation
Follow these steps:
- Start the registry.
- If your computer has DevTest Server installed:
- Start the registry by clicking Start Menu, All Programs, DevTest Solutions, EnterpriseDashboard. Wait until the "Enterprise Dashboard started" message appears.
- Start the registry by clicking Start Menu, All Programs, DevTest Solutions, Registry.
- If your computer has DevTest Workstation installed, use a registry that is running on another computer.
- Click Start, All Programs, DevTest Solutions, Workstation.
- When the Set DevTest Registry dialog opens, select a registry and click OK.
- 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:
- From the DevTest Workstation main menu, select File, New, Project.
The Create New Project dialog opens.
- In the Project Name field, remove the default value and type My Tutorials.
- 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:
- In the Project panel, right-click the Tests folder and select Create New Test Case.
- Set the file name to tutorial1.
- 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:
- In the Project panel, double-click project in the My Tutorials > Configs folder.
The properties editor opens.
- To add a row, click Add at the bottom of the properties editor.
- In the Key field, type config_prop.
- In the Value field, type 42.
- From the main toolbar, click 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:
- Click the tutorial1 tab.
- Click Add Step, select Utilities, and select Output Log Message.
A step named Output Log Message is added to the model editor.
- Right-click the Output Log Message step and select Rename.
- Change the name to My Output Log Message.
- 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 LISA_HOME property is automatically set.
- The java.version property is a system property.
- You added the config_prop property to the project configuration in Step 4.
- You create a property with the name MyOutputLogMessage_step_prop in the log message itself.
The syntax for a property is {{property_name}}.
Follow these steps:
- In the log editor, delete the placeholder text.
- 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.
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:
- Close the first log message step by clicking the arrow at the upper left corner of the window.
- Click 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.
- In the log editor, delete the placeholder text.
- 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.
- Close the second log message step by clicking the arrow at the upper left corner of the window.
- From the main application toolbar, click Save, 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:
- From the toolbar, click the Start ITR.
The ITR opens. The ITR contains an Execution History pane on the left and a set of tabs on the right.
- In the Execution History pane, click 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:
- 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.
- 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:
- In the ITR, click Execute Next Step to run the Output Log Message step.
- 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.
- To view the current and previous property values, click the Properties tab.
- 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:
- Learned how to create and save a test case
- Learned how to add a simple test step (Output Log Message)
- Used a configuration to store properties
- Saw a brief glimpse of the Interactive Test Run utility
Copyright © 2014 CA Technologies.
All rights reserved.
|
|