QuickTest Pro 如何使用可移植库、资源等?

发布于 2024-12-17 11:14:39 字数 229 浏览 2 评论 0原文

我正在自动化环境中使用 QuickTest Pro 设置测试,在该环境中我从 vbscript 调用测试。我需要这些测试来引用库,但我不想依赖这些库的绝对路径(例如C:\myLibrary)。我可以使用相关库(例如..\myLibrary),但是如何让QTP像这样识别这些库呢?我不是 QTP 专家,但我需要使这些测试完全可移植,包括资源和任何其他外部部分。

I am setting up testing with QuickTest Pro in an automated environment where I call the test from a vbscript. I need these tests to reference libraries, but I don't want to rely on an absolute path for those libraries (e.g. C:\myLibrary). I can use relative libraries (e.g. ..\myLibrary) but how do I get QTP to recognize these libraries like this? I'm not a QTP expert, but I need to make these tests completely portable including resources, and any other external parts.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情感失落者 2024-12-24 11:14:39

您可以在“设置”对话框的“资源”选项卡中添加函数库。当您添加对脚本的引用时,它将显示一个对话框,您可以在其中选择路径是相对路径还是绝对路径。我记得您必须单击“是”才能使脚本采用相对路径。

You can add a function library in Resources tab of Settings dialog box. When you add a reference to the script, it will show you a dialog box where in you can choose whether you want the path to be relative or absolute. I remember you have to click Yes for the script to take relative path.

稚然 2024-12-24 11:14:39

遵循佛陀的建议
此外,如果您的测试文件夹之外有一些公共资源,其层次结构位置可能经常更改,您将需要从“选项”>“文件夹路径”设置中找到绝对路径,并在您计划执行测试的每台测试机器上首次设置它。由于此设置是 QTP 应用程序特定的而不是测试特定的,因此不需要更改它们,除非层次结构发生更改。

Folow as Budda suggested
Also if you have some common resources outside your test folder whose hierarchical position can change frequently you will need to locate the absolute path from Options>Folder Path settings and set it for the first-time on every test machine you plan to execute the tests on. As this setting is QTP Application specific and not test specific they need not be changed unless the hierarchy undergoes a change.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文