Connecting QC with VBA to update Test case Status from excel -
i have excel sheet first column test case name , second column test status. want use excel sheet write vb code update status norun --> passed/failed in qc.
as of trying use below code navigate test case unable retrieve current status can update it. please me out same: find code below
sub connecttoqualitycenter() msgbox "starting connectinon" dim qcurl string dim qcid string dim qcpwd string dim qcdomain string dim qcproject string dim tdconnection object dim testsetfact, tstreemgr, tsetfolder, testsetslist, thetestset dim testsetidentifier, tstestfact, testsettestslist, testinstancef, afilter dim lst, tstinstance on error goto err qcurl = "http://pntva30" qcid = "" qcpwd = "" qcdomain = "" qcproject = "" 'display message in status bar application.statusbar = "connecting quality center.. wait..." 'create connection object connect quality center set tdconnection = createobject("tdapiole80.tdconnection") 'initialise quality center connection tdconnection.initconnectionex qcurl 'authenticating username , password tdconnection.login qcid, qcpwd 'connecting domain , project tdconnection.connect qcdomain, qcproject 'on successfull login display message in status bar application.statusbar = "........qc connection done successfully" msgbox "connection established" 'set tsetfact = tdconnection.testsetfactory ' msgbox tsetfact ' set tstreemgr = tdc.testsettreemanager 'msgbox tstreemgr fldpath = "root\mrinaltestfolder\test1\referencedatastandalone" '-- test setpath testsetname = "118-001 new share instrument sent aptp" -- test set name set testsetfact = tdconnection.testsetfactory set tstreemgr = tdconnection.testsettreemanager set tsetfolder = tstreemgr.nodebypath(fldpath) set testsetslist = tsetfolder.findtestsets(testsetname) set thetestset = testsetslist.item(1) testsetidentifier = thetestset.id 'msgbox testsetidentifier testsetidentifier = thetestset.name msgbox testsetidentifier set tfact = tdconnection.testfactory set thetest = tfact.item(1701) -- test case id msgbox thetest.name msgbox thetest.id msgbox thetest.type msgbox thetest.execstatus 'msgbox thetest.status status = thetest.field("ts_status") msgbox status --- getting problem unable present status of no run , instead getting pass status everytime. think returning me previous run status tdconnection.disconnect tdconnection.logout tdconnection.releaseconnection msgbox ("logged out") exit sub err: 'display error message in status bar application.statusbar = err.description msgbox "some error pleas see excelsheet" end sub
Comments
Post a Comment