如何在QTP中获取.tsr文件
我们都知道.tsr文件存储了对象存储库的信息,我们可以将该文件加载到VBS中的一个ObjectRepositoryUtil对象中,然后我们可以通过这个对象做很多事情。 但是如何使用 VBS 捕获窗口中的所有小部件并将其存储到 .tsr 文件中? 我的意思是,当我们在 QTP GUI 中执行以下操作时:
Resources->Object Repository Manager->Object->Add Object->
"CLICK THE WINDOW WE WANT TO CAPTURE"->File->Save
我们实际上获得了窗口的 .tsr 文件以及我们想要捕获的所有组件。 但是我如何在VBS中做到这一点,它有任何API吗? 我查找了名为 ObjectRepositoryUtil 的文档并找到了 GetAllObjects 方法,但这不是同一件事。 有人能解决我的问题吗?我真的很感激。 谢谢。
We all know that the .tsr file stores the information of the object repository, and We can load the file to an ObjectRepositoryUtil Object in VBS, then we can do a lot through this object.
But how can I capture all the widgets in a window and stores into the .tsr file using VBS?
I mean when we do the following in the QTP GUI:
Resources->Object Repository Manager->Object->Add Object->
"CLICK THE WINDOW WE WANT TO CAPTURE"->File->Save
we actually get the .tsr file of the window and all its components we want to capture.
But how can I do this in VBS, does it have any API?
I look up the document called ObjectRepositoryUtil and find the method GetAllObjects, but it is just not the same thing.
Could anyone solve my problem ? I would really appreciate it.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定您为什么要自动创建对象存储库。通常对象存储库创建一次,然后用于创建测试。
您是否熟悉 QTP 的导航和学习功能,它允许在与应用程序交互时添加应用程序中的所有对象。
I'm not sure why you want to automate creating an object repository. Usually object repositories are created once and then used for creating tests.
Are you familiar with QTP's Navigate and Learn feature, it allows adding all objects from an application while interacting with the application.
如果您正在寻找一个可以在 QTP 之外真正模拟 QTP 的对象捕获功能的工具或代码 - 那么目前还没有这样的工具/代码可用。但是,可以编写代码来检索应用程序的对象属性,我假设您已经知道这一点。
If you are looking for a tool or code that can actually mimic the object capturing capability of QTP, outside of QTP - then no such tool/code is available as of now. However code can be written to retrieve the object properties of an application and that I assume you are aware of.