Friday, January 28, 2011

QuickTest Professional Object Model Reference - Utility Statements

Describe Result :-

Return the text description of the error message
Code:-
oBjError = getlasterror
Msgbox (describeresult(oBjError))

ExecuteFile :-

User can call the following format using “ExecuteFile”command in the script level .vbs .txt and .qfl
Code:-
ExecuteFile “FileLocation & file Name”
Note:- Execute file can also call files which is attached in QC also
ExecuteFile ("[QualityCenter] Subject\FileName.vbs")

Exit Action :-

User can call the action based on the function flow or requirement; in meanwhile like to stop the execution of the action we can also use the Exit Action command
Code:-
If RunStatus = “Y” then
Call Runaction "vinodh", "oneIteration"
Else
Exit Action (return Value)
End if
Note:- Return Value populated in the Test result in Quick Test

ExitActionIteration :-

It’s will stop iteration of the function flow
Code :-
If CITY = “USA” then
Call Runaction "vinodh", "oneIteration"
Else
ExitActionIteration(return Value)
End if
Note:- Return Value populated in the Test result in Quick Test

ExitComponent :-

Function used for BPT Testing, exit for the current component run
Code:-
If res = False Then
ExitComponent (return Value)
End If
Note:- Return Value populated in the Test result in Quick Test

ExitComponentIteration :-

Function used for BPT Testing, exit for the current iteration
If res = False Then
ExitComponentIteration(return Value)
End If
Note:- Return Value populated in the Test result in Quick Test

ExitTestIteration :-

Exit current iteration of the Quick Test, Quality centre and BPT component also
If res = False Then
ExitTestIteration (return Value)
End If
Note:- Return Value populated in the Test result in Quick Test

InvokeApplication:-
Invoke the executable application like exe file
Code:-
InvokeApplication "E:\Program Files\Microsoft Internet\IEXPLORE.EXE"

LoadAndRunAction:-

Load the specific action when user require to run the action
Code :-
If CITY = “USA” then
LoadAndRunAction (“Path”,”ActionName”,”Iteration”)
Else
Exit test
End if

Print :-

Display the runtime value from the application
Code:-
Print "VariableName"