How to determine the QTP test script name?
For reporting purposes, there may be a need for you to determine the current testscript name within the code. Below is the code. Please see this to get the code for determinining if the test is being executed from QC or not.
Public function sGetCurrentTestScriptName()
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTestName
if(IsExecutedFromQC()) then
sGetCurrentTestScriptName = qcutil.CurrentTest.Name
else
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
sGetCurrentTestScriptName = qtApp.Test.Name
Set qtApp = Nothing ' Release the Application object
end if
End Function
Advertisement
No comments yet.
Leave a Reply
-
Archives
- December 2010 (3)
- April 2009 (1)
- August 2008 (5)
- July 2008 (4)
- May 2008 (2)
- April 2008 (3)
- February 2008 (3)
-
Categories
-
RSS
Entries RSS
Comments RSS