Reading specific test steps from Quality Center with python -
i working quality center via ota com library. figured out how connect server, lost in ota documentation on how work it. need create function takes test name input , returns number of steps in test qc. far in question.
import win32com win32com.client import dispatch # import codecs #to store info in additional codacs import re import json import getpass #for password qcserver = "***" qcuser = "***" qcpassword = getpass.getpass('password: ') qcdomain = "***" qcproject = "***" td = win32com.client.dispatch("tdapiole80.tdconnection.1") #starting connect td.initconnectionex(qcserver) td.login(qcuser,qcpassword) td.connect(qcdomain, qcproject) if td.connected == true: print "connected " + qcproject else: print "connection failed" #path = "subject\regression\c.001_band_tones" mg=td.treemanager npath="subject\regression" tsfolder = td.testsettreemanager.nodebypath(npath) print tsfolder td.disconnect td.logout print "disconnected " + qcproject
any on descent python examples or tutorials highly appreciated. found this , this, doesn't help.
using ota api data quality center means element path, create factory , use factory search object. in case need treemanager folder in test plan, need testfactory test , need designstepfactory steps. i'm no python programmer hope can out of this:
mg=td.treemanager npath="subject\test" tsfolder = mg.nodebypath(npath) testfactory = tsfolder.testfactory testfilter = testfactory.filter testfilter["ts_name"] = "some test" testlist = testfactory.newlist(testfilter.text) test = testlist.item(1) # there should 1 item print test.name stepfactory = test.designstepfactory steplist = stepfactory.newlist("") step in steplist: print step.stepname
it takes time used qc ota api documentation find helpful. of knowledge comes examples in api documentation—for problem there examples "finding unique test" or "get test object name , path". both examples examples test object. if examples in vb should no big thing adapt them python.
Comments
Post a Comment