ExecuteFile Print Statement QTP

How to use Execute File Print Statement in QTP:

Executes the VBScript statements in the specified file. After the file runs, the definitions (functions, subroutines, classes, etc.) in the file are available from the global scope of the action's script.

Note: You cannot debug a file that is called using an ExecuteFile statement, or any of the functions contained in the file. In addition, when debugging a test that contains an ExecuteFile statement, the execution marker may not be correctly displayed.

Syntax

ExecuteFile File



Argument

Type

Description

File

String

The absolute or relative path of the file to execute.

Example

The following example executes the MyFunction VBS file in order to use the SomeFunction function in the action script.

ExecuteFile "MyFunctions.vbs"

x = SomeFunction ' Defined in MyFunctions.vbs
Description

Displays information in the QuickTest Print Log window during the run session. The QuickTest Print Log window remains open while the run session continues, until you close it.

For more information, see the HP QuickTest Professional User Guide.

Syntax

Print (Message)



Argument

Type

Description

Message

String

String expression displayed as the message in the QuickTest Print Log window.

Example

The following example iterates all the items in the Flight Table dialog (in the sample Flight application) and uses the Print utility statment to print the content of each item to the QuickTest Print Log window.

Set FlightsList = Window("Flight Reservation").Dialog("Flights Table").WinList("From")

For i = 1 to FlightsList.GetItemsCount

              Print FlightsList.GetItem(i - 1)

No comments:

Post a Comment