Created
September 18, 2009 06:37
-
-
Save bulkan/188917 to your computer and use it in GitHub Desktop.
Python script to run a QTP test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32com, win32com.client | |
qtp = win32com.client.Dispatch("QuickTest.Application") | |
# starts up QTP | |
qtp.Launch() | |
# make the QTP window visible | |
qtp.Visible = True | |
# Open a test, replace the path | |
qtp.Open("C:\Tests\test1") | |
# to open a QTP test in Quality Center | |
# qtp.Open(r"[QualityCenter] Subject\FolderName\QTPScript") | |
# create a RunResultsOptions object | |
qtResultsOpt = win32com.client.Dispatch("QuickTest.RunResultsOptions") | |
# set the location to where the results will be save | |
qtResultsOpt.ResultsLocation = "C:\Test\test1\res" | |
qtp.Test.Run(qtResultsOpt) | |
print "Test has %s" %qtp.Test.LastRunResults.Status | |
# close the Test | |
qtp.Test.Close() | |
# quit QTP | |
qtp.Quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment