Wednesday, 16 September 2015

METHODS IN QTP


Reporter.ReportEvent:

Description:
Reports an event to the test results.
Syntax :
Reporter.ReportEvent EventStatus, ReportStepName, Details [, Reporter]
Argument
Type
Description
EventStatus
Number or pre-defined constant
Status of the report step:
0 or micPass: Causes the status of this step to be passed and sends the specified message to the report.
1 or micFail: Causes the status of this step to be failed and sends the specified message to the report. When this step runs, the test fails.
2 or micDone: Sends a message to the report without affecting the pass/fail status of the test.
3 or micWarning: Sends a warning message to the report, but does not cause the test to stop running, and does not affect the pass/fail status of the test.
ReportStepName
String
Name of the intended step in the report (object name).
Details
String
Description of the report event. The string will be displayed in the step details frame in the report.
Reporter
N/A
Not in use.
Example:
The following examples use the ReportEvent method to report a failed step.
Reporter.ReportEvent 1, "Custom Step", "The user-defined step failed."
or
Reporter.ReportEvent micFail, "Custom Step", "The user-defined step failed."
-------------------------------------------------------------------------------------------------
DataTable.Value:

Description :
DataTable default property. Retrieves or sets the value of the cell in the specified parameter and the current row of the run-time Data Table.
Note: This property returns the computed value of the cell. For example, if the cell contains a formula, the method returns True or False.
Syntax :
To find the value:
DataTable.Value(ParameterID [, SheetID])

Argument
Type
Description
ParameterID
Variant
Identifies the parameter (column) of the value to be set/retrieved. Index values begin with 1.
SheetID
Variant
Optional. Identifies the sheet to be returned. The SheetID can be the sheet name, index or dtLocalSheet, or dtGlobalSheet.
If no Sheet is specified, the first sheet in the run-time Data Table is used (global sheet). Index values begin with 1
-------------------------------------------------------------------------------------------------
Parameter.Item (parametername):

Parameter:  A value that is defined or generated separately from the step and is retrieved when the specific step runs.
Configuring a Parameter Value :
If you select Parameter for a value that is already parameterized, the Parameter box displays the current parameter definition for the value. If you select Parameter for a value that is not yet parameterized, the Parameter box displays the default parameter definition for the value.

Setting Test and Action Parameter Options
Test and action parameters enable you to use parameter values that have been passed from the external application that ran (called) your test. The Parameter options that are available depend on where you are currently located in your test, and whether test or action parameters are defined
When Test/action parameter is selected as the parameter type, you can select the required parameter in the Parameter Options dialog box. You open the Parameter Options dialog box by clicking the Parameter Options button in any Checkpoint Properties dialog box
Defining the Settings for a Test or Action Parameter
The following options are available for configuring test or action parameters:
  • Test parameters or Parent action parameters. Parameter defined in the test or parent action. (If no output parameters are defined in the test or parent action, this area is disabled.) Test parameters are available only for top-level actions. They are defined in the Parameters tab of the Test Settings dialog box. Parent action parameters are available for subsequent steps and for nested actions. They are defined in the action containing the steps or in the action that calls the nested action.
    • Parameter. Specifies the name of the input parameter. The read-only list of available parameters contains the names and full descriptions of the currently defined input parameters for the action. You can resize the display, as needed, and, if the list of parameters is long, you can scroll through the list.
  • Output from previous action call(s). Any previous action in the same hierarchical level for which output parameters are defined. (If no output parameters are defined in previous actions, this area is disabled.)
    • Action. Specifies the previous action from which you can choose an output parameter. You can choose any action in the list.
    • Parameter. Specifies the name of the output parameter. The read-only list of available parameters contains the names and full descriptions of the currently defined output parameters from the previous action(s). You can resize the display, as needed, and, if the list of parameters is long, you can scroll through the list. 
    •    Subscribe  channel to get  latest video 
    • https://www.youtube.com/channel/UC1EmncBu2maDiHNMNNqxw9g 


1 comment: