我可以在 QTP 中引用另一个函数库吗

发布于 2024-11-18 13:50:27 字数 100 浏览 4 评论 0原文

我想在 QTP 中的另一个函数库中引用一个函数。

这是编程基础知识,但阅读 QTP 帮助,看起来一切都必须通过“测试”层访问,这意味着编写实用程序函数,例如日期处理程序。

I want to reference a function from one Function Library in another in QTP.

This is programming basics but reading QTP help, it looks like everything has to be accessed through the 'Test' layer which means that writing utility functions such as date handlers.

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

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

发布评论

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

评论(1

倾城月光淡如水﹏ 2024-11-25 13:50:27
  1. 您确实可以在动作脚本中编写函数。 您不必编写函数库来编写和使用自定义函数。为了可重用性,函数库很有意义。

  2. 您可以在一个函数库中放入任意数量的函数。

  3. < p>如果您想创建多个函数库,只需将它们全部添加到每个测试的资源设置中。

  4. 如果函数库相互依赖,您应该确保在测试设置中以正确的顺序引用它们。

  5. VBScript 中有一个 ExecuteGlobal 语句,它允许您指定包含函数定义的(巨大)字符串。 使用这样的字符串执行 ExecuteGlobal 将声明所有这些函数。这是(除了 ExecuteGlobal 的姊妹函数,如 ExecuteFile(或者它叫什么?))使用函数库的唯一真正替代方案。

  1. You can indeed write functions in action scripts. You do not have to write function libraries to write and use custom functions. For reusability, function libraries make sense.

  2. You can put as many functions into one function library as you wish.

  3. Should you want to create more than one function library, you simply add them all to the resources settings of each test.

  4. If function libraries depend on each other, you should make sure to reference them in the correct order in the test settings.

  5. There is an ExecuteGlobal statement in VBScript which would allow you to specify a (huge) string containing function definitions. Executing ExecuteGlobal with such a string would declare all those functions. This is (besides ExecuteGlobal's sister functions, like ExecuteFile (or what was it called?)) the only real alternative to using function libraries.

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