如何将静态vbs文件与UFT中的Test关联并保存

时间:2017-10-31 18:18:09

标签: vbscript hp-uft alm

我在ALM中进行了200次UFT(14)测试,我需要将每个函数库关联到10个,将测试保存回ALM(11.53)并检查测试计划中的测试。

有没有办法做到这一点?

我知道有4种方法可以将vbs文件与Test相关联。

1)使用'文件>设置>资源>在QTP中关联函数库的选项。

2)使用自动化对象模型(AOM)。

3)使用ExecuteFile方法。

4)使用LoadFunctionLibrary方法。

    In that Method - 3, 4 --> has association only in Runtime (taking long time to start 
the execution ~ 2 mins per execution)

    Method - 2 --> needs to trigger execution from local. I tried this by using the below 
code but the Test is not getting saved back to ALM.

    Method - 1 --> Better approach, but can't do it manually for all 200 tests

以下是代码

Set objCon = CreateObject("TDApiOle80.tdconnection")
objCon.InitConnectionEx URL
objCon.Login User, Pass
objCon.Connect Domain, Project

gstrRelativePath = "[ALM] Subject\Automation Development\Training"

Set gobjQtpApp = CreateObject("QuickTest.Application")
gobjQtpApp.Open gstrRelativePath & "\Test"  

Set objQtpSettings = gobjQtpApp.Test.Settings
Set objQtpLibraries = objQtpSettings.Resources.Libraries
objQtpLibraries.RemoveAll
objQtpLibraries.Add "Support Libraries\" & objFile.Name
gobjQtpApp.Test.Save

0 个答案:

没有答案