您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 质量控制/管理 > 通过QC(ALM)的OTA执行测试集并发送邮件
通过QC(ALM)的OTA执行测试集并发送邮件参考:ExecutingQCTestSetviaOTAAPI(QCRunTestSet)是QC(ALM)的自动化接口,通过它可以控制QC执行自动化测试集,下面是完整的代码:'VBScriptDocumentOptionExplicit'QCParamtersDimServer,UserName,Password,QCDomain,QCProject,QCTestSetPath,QCTestSetNameServer==john.smithPassword=passwordQCDomain=DEFAULTQCProject=theProjectQCTestSetPath=Root\TestSetFolderQCTestSetName=DailyRegression'''summary'''LoadsaninstanceofQCRunTestSetandinitiatestheschedulingcontroller'''/summary'''paramname=ServerQCServer/param'''paramname=UserName/param'''paramname=Password/param'''paramname=DomainDomainname/param'''paramname=ProjectProjectname/param'''paramname=QCTestSetPathPathtotheTestSet(Root\FolderName\SubFolderName)/param'''paramname=QCTestSetNameNameofthetestset/param'''remarks/remarksPublicSubRunTestSet(Server,UserName,Password,QCDomain,QCProject,QCTestSetPath,QCTestSetName)DimQCTestSetExec,sErr,arrArgs,ix,arg,bExitsErr=UnabletoexecuteRunTestSet.PleaseprovidethearrArgs=Array(Server,UserName,Password,QCDomain,QCProject,QCTestSetPath,QCTestSetName)bExit=FalseForix=LBound(arrArgs)ToUBound(arrArgs)Executearg=&arrArgs(ix)Ifarg=ThenMsgBoxsErr&arrArgs(ix)&.,vbOkOnly,Error!bExit=TrueEndIfNextIfbExitThenExitSubSetQCTestSetExec=NewQCRunTestSetWithQCTestSetExec.Server=Server.UserName=UserName.Password=Password.QCDomain=QCDomain.QCProject=QCProject.QCTestSetPath=QCTestSetPath.QCTestSetName=QCTestSetName.RunEndWithSetQCTestSetExec=NothingEndSub'''summary''''''/summary'''remarks/remarksClassQCRunTestSet'PublicVariables'''summary'''QCServerURL(string)'''/summary'''remarks/remarksPublicServer'''summary'''UserName(string)'''/summary'''remarks/remarksPublicUserName'''summary'''Password(string)'''/summary'''remarks/remarksPublicPassword'''summary'''QualityCenterDomain(string)'''/summary'''remarks/remarksPublicQCDomain'''summary'''QCProject(string)'''/summary'''remarks/remarksPublicQCProject'''summary'''QCTestSetFolderPath(string)'''/summary'''remarksRoot\TestSetFolder\TestSetSubFolder/remarksPublicQCTestSetPath'''summary'''TargetTestSetName(string)'''/summary'''remarks/remarksPublicQCTestSetName'''summary'''RecipientlistfromQC'sAutomationtab'''/summary'''remarks/remarksPublicEMailTo'''summary'''TSTestFactorymanagestestinstances(TSTestobjects)inatestset'''/summary'''remarks/remarksPublicTSTestFactory'''summary'''Numberofblockedtestsaftercompletionofscheduler(integer)'''/summary'''remarks/remarksPubliciBlocked'''summary'''Numberoffailedtestsaftercompletionofscheduler(integer)'''/summary'''remarks/remarksPubliciFailed'''summary'''NumberofN/Atestsaftercompletionofscheduler(integer)'''/summary'''remarks/remarksPubliciNA'''summary'''NumberofNoRuntestsaftercompletionofscheduler(integer)'''/summary'''remarks/remarksPubliciNoRun'''summary'''NumberofNotCompletedtestsaftercompletionofscheduler(integer)'''/summary'''remarks/remarksPubliciNotCompleted'''summary'''NumberofPassedtestsaftercompletionofscheduler(integer)'''/summary'''remarks/remarksPubliciPassed'''summary'''DateTimestampatthestartoftheSchedulingsession(DateTime)'''/summary'''remarks/remarksPublicdtStartTime'PrivateVariables'''summary'''QuickTest.Applicationobject'''/summary'''remarks/remarksPrivateqtApp'''summary'''TDApiOleobject'''/summary'''remarks/remarksPrivateTDConnection'''summary'''TSSchedulerobjectreturnedbytheStartExecutionmethod'''/summary'''remarks/remarksPrivateTSScheduler'''summary'''TestSetFolderobject'''/summary'''remarks/remarksPrivateTSFolder'''summary'''Executesthescheduler'''/summary'''remarks/remarksPublicDefaultSubRun()DimbStatus,dtStartTime'@seeisQCConnected()bStatus=isQCConnected'@seeisQTPInstalled()IfbStatusThenbStatus=isQTPInstalledIfNotbStatusThenExitSubDimTSTreeManager,QCTestSetPath,TSList,QCTestSetName,TestSet,qtTest,sEnvironment,TSReport,EMailTo,ExecutionStatus'TestSetTreeManagermanagesthetestsettreeanditsrelatedtestsetfoldersSetTSTreeManager=TDConnection.TestSetTreeManagerQCTestSetPath=Me.QCTestSetPath'ReturnthetestsettreenodefromthespecifiedtreepathSetTSFolder=TSTreeManager.NodeByPath(QCTestSetPath)QCTestSetName=Me.QCTestSetName'Returnsthelistoftestsetscontainedinthefolderthatmatchthespecifiedpattern.SetTSList=TSFolder.FindTestSets(QCTestSetName)IfTSList.Count=0ThenMsgBoxTheTestSet'&QCTestSetName&'wasnotfound.,vbOkOnly,TSFolder.FindTestSetsException!ExitSubEndIfForEachTestSetinTSListIfLCase(TestSet.Name)=LCase(QCTestSetName)ThenExitForEndIfNext'ThisenablesdatabasetoupdateimmediatelywhenthefieldvaluechangesTestSet.AutoPost=True'TSTestFactorymanagestestinstances(TSTestobjects)inatestsetSetTSTestFactory=TestSet.TSTestFactorySetMe.TSTestFactory=TSTestFactory'TSTestFactory.NewList()createsalistofobjectsaccordingtothespecifiedfilterForEachqtTestinTSTestFactory.NewList()'Changetest
本文标题:通过QC(ALM)的OTA执行测试集并发送邮件
链接地址:https://www.777doc.com/doc-422890 .html