What is descriptive programming (Programmatic Desc

2019-02-18 12:12发布

What is descriptive programming in QTP?

标签: qtp hp-uft
16条回答
淡お忘
2楼-- · 2019-02-18 12:59

In Simple words we can say Describing the object via Code, Instead of Object repository.

Sample Code

Browser("title:=Google").Page("title:=Google").Link("text:=Advanced Search").Click

Object Based Code

Browser("Google").Page("Google").Link("Advanced Search").Click

And you Need object for all

查看更多
淡お忘
3楼-- · 2019-02-18 12:59

Descriptive Programming is used to perform operations on the object which we are not present in qtp.It uses [Property ->value]. Please refer below link:-

Descriptive Programming Simplified

查看更多
放我归山
4楼-- · 2019-02-18 13:01

Using Descriptive programming we can define an objects in the QTP without using the OR (object repository) Here is a good tutorial that describes three ways to do descriptive programming: http://www.bytetips.com/descriptive-programming-in-qtp/

查看更多
甜甜的少女心
5楼-- · 2019-02-18 13:02

Creating a test without using the object repository is known as descriptive programming since you describe the objects as part of the script.

e.g.

Browser("title:=Google").Page("title:=Google").Link("text:=Advanced Search").Click

Note the := in the test objects' names, this is not a smiley it means that the property title has value Google (as a regular expression).

You can also use the Description object via Description.Create.

You can see more details here.

查看更多
smile是对你的礼貌
6楼-- · 2019-02-18 13:05

Identifying the objects in your page without Object Repository with special property The most used for Descriptive objects when you have more than one object in the same page with same E.g. HTML ID and you need to click on all of it ... you can return all objects and making loop to click on the object that you identify in object script with it's property(s)

查看更多
可以哭但决不认输i
7楼-- · 2019-02-18 13:12

Think of it as finding a location (like finding the object), object repository works as a map app (e.g., Google map), you just have to give the recorded location and it will find it for you.

Descriptive programming is basically you understand the object and its elements. It means you know way to go home or at least have a map with you in order to find the location.

Both have pros and cons. Say if your phone is dead, or there's no network, Google maps (object repository) won't work for you anymore. You have to go with a native way.

查看更多
登录 后发表回答