qtp中Object(poroperty)有什么用 [英] what is the use of Object(poroperty) in qtp

查看:45
本文介绍了qtp中Object(poroperty)有什么用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如Object(poroperty)有什么用

what is the use of Object(poroperty) for example

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

用这个代替

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

推荐答案

这被称为 Descriptive ProgrammingProgrammatic Description 当对象的描述内联在脚本中时而不是在对象存储库 (OR) 中.

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(=).

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

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 很有用.

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

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

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.

这篇关于qtp中Object(poroperty)有什么用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆