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"

Tuesday, January 4, 2011

Quick Test Object Reference Model

Crypt Object – Encrypt Method  
          Encrypt the string variable using Encrypt Method Ex: User can use the Password for securities

Pwd = "vinodh"
Cpwd = Crypt.Encrypt (Pwd)
Msgbox Cpwd

Data Table Method
          Quick Test have feature to create the multiple test data and stored in the Data Table and handled in the runtime.  Scripts will store the temporally in the Data table; User can see the test data in the QT Result window    

Addsheet Method
          Run time user can add the new sheet with test data  
Ex:
a = Datatable.AddSheet("Vino").AddParameter("Name","Check")
print a

Export Method
          Quick Test store the test data value into excel format based on the location
Ex:
a = Datatable.AddSheet("Vino").AddParameter("Name","Check")
print a
DataTable.Export("C:\Vinodh\TestLog.xls")

Delete Method
          Delete the sheet while running the test data table Index value is :1
Ex:
a = Datatable.AddSheet("Vino").AddParameter("Name","Check")
print a
DataTable.DeleteSheet("Vino")

ExportSheet Method

          Export the specific test data sheet from the runtime data table
Index value is : 1

a = Datatable.AddSheet("Vino").AddParameter("Name","Check")
print a
DataTable.ExportSheet "C:\Vinodh\TestLog.xls",3


GetRowCount Method
          Return the total no of the row available in this particular sheet
a = Datatable.AddSheet("Vino").AddParameter("Name","Sona")
print a
ss = Datatable.GetSheet("Vino").GetRowCount
print ss

GetSheet Count Method
          Return the number of sheet count available in excel sheet
DataTable.Export("C:\Vinodh\TestLog.xls")
sheetcount = DataTable.GetSheetCount
print sheetcount