Output Values
Output Values Overview
QuickTest enables you to retrieve values in your test and store them in output value objects.An output value step is a step in which one or more values are captured at a specific point in your test and stored for the duration of the run session. The values can later be used as input at a different point in the run session.
You can output the property values of any object. You can also output values from text strings, table cells, databases, and XML documents.
Output Value Categories
You can create the following categories of output values:
Standard output values:output the property values of most objects
Text and text area output values: output a part of the object’s text. You can also specify the text before and after the output text.
Table output values: output the contents of table cells
Database output values: output the value of the contents of database cells, based on the results of a query
XML output values: capture and output the values of XML elements and attributes in XML documents
Existing output values:insert existing output values into your test. Each time an output value step is performed, the value contained in the output value is overwritten with the new output value.
Output Types and Settings
Default Output Definitions:If no output parameters are defined in the action, the default output type is Data Table, otherwise the default output type is Test/action parameter.
The output value statement is displayed in the Expert View with the following syntax: Object.Output CheckPoint(Name)
Storing Output Values
Test and action parameters
The run-time data table
Environment variables:You can output values only to internal user-defined environment variables.
Output values are stored only for the duration of the test, and are not saved with the test. If you select to output a value to an existing parameter, a data table column, or an environment variable, the existing value is overwritten when the output value step runs. When the run session ends, the original value is restored.
Task:
Create or Modify a Standard Output Value Step
add pic: Output Value Properties Dialog Box 803
Create or Modify a Text Output Value Step
Value Configuration and Regular Expressions
QuickTest enables you to configure the values for properties and other items by defining a value as a constant or a parameter.
Constant. A manually defined value that remains unchanged for the duration of the test. In certain contexts, you can define a constant value using a regular expression.
Parameter. A value that is defined or generated externally and is retrieved during a run session.
Regular Expressions Overview
A regular expression is a string that specifies a complex search phrase.Regular expressions are used to identify objects and text strings with varying values. You can use regular expressions to instruct QuickTest to find a value that matches a particular pattern or condition instead of a specific hard-coded value.
Regular Expressions for Property Values:If you expect the value of an object property in your application to change in a predictable way during each run session, you can use regular expressions when defining identification property values
Regular Expressions in Checkpoints: When creating a standard checkpoint to verify the property values of an object, you can set the expected value of an object’s property as a regular expression so that an object with a varying value can be verified.
tDate = Date
'msgbox(tDate)
tMonth = MonthName(Month(CDate(tDate)), true)
tDay = Day(Date())
tYear= Year(Date())
If tDay tDay="0"& tDay
End If
tdate_ddmonyyyy = tDay & " " & tMonth & " " & tYear