Wednesday, February 8, 2012

Object Repository & Descriptive Programming together

Sometimes we need to use both QTP's own Object Repository and Descriptive Programming while defining complex objects. But this scenario do not works always.

The following care must be taken while designing scripts when you are using both Object Repository & descriptive Programming.

Scenario 1 : Parent object as Object Repository with child object as Descriptive Programming.
Browser("My Website").Page("micclass:=Page").WebEdit("micclass:=My Edit').Set "QuickTest"
'This code works properly

Scenario 2 : Parent object as  Descriptive Programming with child object as  Object Repository.

Browser("micclass:=Browser").Page("My Page").WebEdit("My Edit').Set "QuickTest"
'This code will generate error

Hence whenever you are using Object Repository & Descriptive Programming together take care that parent object should be from Object Repository & not from Descriptive Programming.

No comments:

Post a Comment