what is the use of Object(poroperty) in qtp

萝らか妹 提交于 2019-12-11 08:06:47

问题


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")

回答1:


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.



来源:https://stackoverflow.com/questions/3610692/what-is-the-use-of-objectporoperty-in-qtp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!