开发者

is Discriptive Program needed Object Repository?

is Discriptive Program needed Object Repository?开发者_运维技巧 give me an example.


Descriptive programming is used when we want to perform an operation on an object that is not present in the object repository. The QTP documentation has lots of information on this and many blogs on the internet have articles, such as : Descriptive Programming Simplified.

Please restate your question if you want more help.


It has become my understanding that "Descriptive Programming" is basically the Opposite of the Object Repository... (meaning: if a statement refers to a named test object that is in the repository, then it's not descriptive programming, and vice versa: if the test object is described in a statement instead of specifying a named test object from the repository, then you are using descriptive programming)

Therefore, to answer your question, I would say No. Descriptive Programming is NOT necessary for Object Repository.

Now, with that said, let me expand a little further to say - you really should want to understand the concepts of Descriptive Programming in order to build a good Object Repository... For example, understanding how descriptors are specified in a statement and how to concatenate multiple descriptors together to try to identify specific runtime objects is helpful when it comes too designing a test object that will be stored in the repository.

I'd also like to add that even if you build a comprehensive object repository, Descriptive Programming still has a place in your toolkit... For example, when you want to find an object in you application that might be either Object A from the repository, or Object B from the repository (two different predefined test objects), you can pro grammatically construct a test object description and use Descriptive Programming to find that object on the application.


Descriptive programming doesn't require any object repository. We are using the descriptive programming for fast execution. Also, there are some situations like same object properties matches with more objects in same page, we can use descriptive programming for eg, Suppose we have 10 checkboxes in the application with same object properties, we can use the following code for selecting all these boxes

'create description object
Set Desc=description.Create()

'assign unique properties

Desc("html id").value="chk_id"


Desc("name").value="check_details" 

'storing into descriptive object

Set obj=Browser(Obrowser).Page(Opage).ChildObjects(Desc)

'finding total number of objects

cnt=obj.count()

For i=0 to cnt-1

   obj(i).Set "ON"

Next

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜