8231942 qtp object repository descriptive programming and beyond

28
QTP: Object Repository, Descriptive Programming and Beyond Prepared by: Igor Gershovich

Upload: n-lalitha-siva-jyothi

Post on 11-Sep-2015

232 views

Category:

Documents


0 download

DESCRIPTION

QTP

TRANSCRIPT

  • QTP: Object Repository, Descriptive Programming and BeyondPrepared by: Igor Gershovich

  • Object Repository vs. Descriptive Programming what to use?There really is no best wayUse the method that gives your company the best ROI, whether that be Object Repository (OR), Descriptive Programming (DP) or a mixture of both

  • OR Pros and ConsPROS:GUI Front end to examine all the objects in the repositoryHighlight in Application feature is great tool to walk the object treeNo need to modify the script when object properties changesEasy to identify objects in AUT by Object Logical namesCan be created independently from scripts

  • OR Pros and ConsCONS:Additional layer to maintainUnnecessary objects can be createdMultiple users cannot concurrently save/write to the shared ORIt wont eliminate the need for Descriptive Programming in most of cases

  • DP Pros and ConsPROS:Its a white boxCompatible with different QTP versionsCode portability is highEasy to mass update

  • DP Pros and ConsCONS:Lower Code Readability and requires more comments, like what object is accessedPotentially slower to create To highlight an object in the application requires utilizing the Highlight method

  • What is Object Repository?Object Repository is a place where QTP stores learned objects QTP uses default Object Identification properties: mandatory and assistive to learn objects into OR

  • Object RepositoryLogical NameProperties

  • OR: Object identification default properties

  • Script playback using ORQTP finds the Object in Object Repository using object Logical Name and Object HierarchyQTP retrieves Test Object properties from ORQTP searches actual application for the Object with the same properties as the OR Test Object and performs user action

  • Script playback using Descriptive programmingQTP searches the Application Under Test (AUT) for the Object using Descriptive properties and performs user action

  • Descriptive programming when and why?Consider using DP in following cases:Dynamic object propertiesExample: Link Logout Same objects on every pageExample: Buttons Next, Back, Cancel, OKLots of similar objects on one pageExample: table with many First & Last name text boxes

  • Different ways to work with objects

  • Different ways to work with objectsExample for Passenger 1 First Name

  • ChildObjects method using Collection Object

  • ChildObjects method using Collection ObjectLast Name fields are populated

  • TO, RO and .Object.GetTOproperty/SetToProperty refers to the properties stored in OR.GetROProperty property refers to the AUT Object property (Run-time).Object. refers to the AUT Object NATIVE properties/methods

  • Better names for Object Spy radio-buttonsRun-Time NATIVE ObjectRun-Time QTP (Test) Object

  • Object Run-Time Properties from AUT (GetRoProperty)

  • Run-Time Native Object Properties/Methods from AUT (.Object)

  • Test Object Properties from ORSet/GetToProperty

  • Regular Expressions in ORExample: Server independent Page object1. Click on Property value to access RegEx2. Click RegEx Icon

  • Regular Expressions in OR

  • Regular Expressions in ORRegEx icon

  • Object Smart IdentificationSmart Identification is not Artificial IntelligenceSI uses loose/unreliable object recognitionIts recommended to disable SI for each and every page/window/control using the Tools->Object Identification dialog (Recording)Another way to disable SI: File -> Settings -> Run -> Check the "Disable Smart Identification during run session" check box (Run-Time)

  • Smart Identification (SI) Recording OptionsSI Checkbox

  • Smart Identification (SI) Run OptionSI Checkbox

  • Igor GershovichE-Mail: [email protected]: 720-933-9395