tags:

views:

31

answers:

1

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  A: 

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.

Motti