As promised, check the code below will let you connect to QC
the below walks you through the test tree and updates the status of test cases.
you can use this as a function can call it in python script to update.
this was pretty useful to me , hops is the same case with you.
import win32com
from win32com.client import Dispatch
qcServer = "http://xxxxxxxxx/qcbin/"
qcUser = "xxxxx"
qcPassword = "xxxxx"
qcDomain = "xxxx"
qcProject = "xxxx"
t = win32com.client.Dispatch("TDApiOle80.TDConnection.1")
t.InitConnectionEx(qcServer)
t.Login(qcUser,qcPassword)
t.Connect(qcDomain,qcProject)
print "Logged in"
mg=t.TreeManager
npath="Root\xxxxxx"
tsFolder = t.TestSetTreeManager.NodeByPath(npath)
print tsFolder
tfactory=tsFolder.TestSetFactory
td_tsff=tfactory.Filter
td_testset=td_tsff.NewList()
for otest in td_testset:
print otest.Name
td_TSTestSetFactory = otest.TSTestFactory
td_tstsff = td_TSTestSetFactory.NewList("")
for otestitem in td_tstsff:
print otestitem.Name
td_RunFactory = otestitem.RunFactory
obj_theRun = td_RunFactory.AddItem("testrun")
obj_theRun.Status = "Passed"
otestitem.Status= "Passed"
obj_theRun.Post()
print otestitem.Status
next
next
tsFolder = None
tfactory = None
td_testset = None
td_TSTestSetFactory = None
td_RunFactory = None
obj_theRun = None
t.logout
t = None
print "done"
Showing posts with label python HP. Show all posts
Showing posts with label python HP. Show all posts
Tuesday, December 20, 2011
Monday, December 19, 2011
Python with Quality center
We fall back to the topic of test management . we can use all the scripting languages in the world but it boils down to the point on how will you report the status of the testing to your management . well that is true for almost every testing activity manual or automation.
I was wondering what to use , could it be a custom python script to prepare a report or off the shelf product . after going through a bunch of processes , Proof of concepts I came to a conclusion that we can write something in relatively less time but maintaining it is a problem. when I looked at any test management tool that supports python , I came across Quality Center. they have a OTA framework which makes is relatively simple to access their APIs. I spent time on it and found relatively simple to connect with the com objects.
my suggestion , if you have access to QC in your company , give it a shot , should be simple and straight forward for you to use.
I will be posting how to connect to QC from a python script pretty soon.
Subscribe to:
Posts (Atom)