如何通过AOM框架执行UFT脚本?

时间:2018-11-12 11:24:13

标签: hp-uft

我有五个自动脚本,想在一夜之间执行。谁能让我知道如何执行它?

1 个答案:

答案 0 :(得分:1)

是的,您可以使用应用程序对象模型(AOM)使用任务计划程序来计划那些任务。 有很多方法,一种可以在下面编写的方法可以使用: 创建一个vbs文件并使用Windows Scheduler触发它。您可以编写代码以在UFT中选择执行脚本。请参考下面的代码以供参考。

    Set obj = CreateObject("Quicktest.Application")
'// Set AOM file and test script path
obj.Visible = True 
obj.Launch
obj.Options.Run.ImageCaptureForTestResults = "OnError"
obj.Options.Run.RunMode = "Fast"
obj.Options.Run.ViewResults = False

obj.Open path     '----"path of your script"
        obj.Test.Run qtpResults,True
        VarStatus =obj.Test.LastRunResults.Status
obj.Test.Close

如果您需要其他帮助,请告诉我。很高兴为您提供帮助:-)