qtp中Object(poroperty)有什么用

发布于 2024-09-17 18:51:17 字数 236 浏览 1 评论 0原文

Object(poroperty) 有什么用,例如,

JavaWindow(something).JavaStaticText("class_index="&i) ''# i is the increment variable.

使用这样的而不是

JavaWindow("Form").JavaStaticText("Name")

what is the use of Object(poroperty) for example

JavaWindow(something).JavaStaticText("class_index="&i) ''# i is the increment variable.

what are the uses using like this instead of

JavaWindow("Form").JavaStaticText("Name")

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

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

发布评论

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

评论(1

野味少女 2024-09-24 18:51:17

这称为“描述性编程”或“编程描述”,即对象的描述内联在脚本中而不是对象存储库 (OR) 中。

尽管语法应该是冒号 equals (:=) 而不仅仅是 equals(=),但语法略有错误。

QTP 中常见的测试对象存储在 OR 中,因此当您说 JavaWindow("something") 时,QTP 会在 OR 中查找名为 JavaWindow 类型的对象“something” 并检查描述是什么(例如 text == “OK”)。在 DP 中,您可以在脚本中内联指定描述。

当对象的描述依赖于测试流程时,DP 非常有用。

需要注意的一件事是,在 DP 中,所有属性值都被视为正则表达式(如果您使用 Description 对象,则可以更改这一点)。

这是一篇包含更多信息的博客文章

This is known as Descriptive Programming or Programmatic Description it's when the object's description is inline in the script rather than in the Object Repository (OR).

You have the syntax slightly wrong though it should be colon equals (:=) and not just equals(=).

Usual test objects in QTP are stored in the OR so when you say JavaWindow("something") QTP looks in the OR to find an object of type JavaWindow named "something" and checks what the description is (for example text == "OK"). In DP you specify the description inline in the script.

DP is useful when the description of an object is dependant on the test flow.

One thing to note is that in DP all property values are treated as regular expressions (this can be changed if you use a Description object).

Here's a blog post with more information.

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