【发布时间】:2014-06-18 08:52:06
【问题描述】:
我的目标是从对象存储库文件 (.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)
【问题讨论】: