haripotter’s technorati

Just another WordPress.com weblog

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

December 28, 2010 - Posted by | HP Quality Center and QTP

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.