我的目标是从对象存储库文件 (.tsr) 中获取一个对象,并对该对象执行一些操作,例如单击、设置...在下面的代码中,“WebButton”对象被捕获。但是当我对这个对象(brObj)执行“点击”操作时。在 UFT 中收到错误消息“由于不可恢复的错误行 (20):brObj.Click 无法继续测试运行”
Dim RepositoryFrom, brObj
Dim ObjectRepositoryPath, str, pgStr, btnStr
ObjectRepositoryPath="C:\Repository2.tsr"
Set RepositoryFrom = CreateObject("Mercury.ObjectRepositoryUtil")
RepositoryFrom.Load ObjectRepositoryPath
str = "Browser("+""""+"Title"+""""+")"
pgStr = "Page("+""""+"Title"+""""+")"
btnStr = "WebButton("+""""+"Login"+""""+")"
'MsgBox str
set brObj = RepositoryFrom.GetObject(str+"."+pgStr+"."+btnStr)
brObj.Click 'Getting error for this line
那么 UFT 中是否有另一种方法可以对检索的对象执行操作
来自对象存储库文件 (.tsr)