Wednesday, 14 October 2015

Maintenance Run Mode

Although Checkpoint Technologies is always there for us, whether we need help with writing scripts or upgrading projects, it is nice to be able to debug our code ourself. Generally in QTP when we record and run the Script by default it will be run by Normal run mode and it will throw an error message if the QTP doesn’t identify the object or if any syntax erros got found in scripts
Maintenance Run Mode is a tool, included in your QuickTest Professional application that will help you to post your successful run results in a place of prominence in your world.
Maintenance Run Mode helps us to maintain our QTP tests when our Application Under Test (AUT) changes.   Maintenance Run Mode runs while QTP steps through our test. It points out where object recognition has failed, and then it helps us in making the necessary changes to our script and Object Repository (O. R.).  Maintenance Run Mode is like a magic little friend, or even a wizard helping us to make sure that our scripts always identify our objects correctly.
Maintenance Run Mode is especially useful when we receive the error message, “Cannot identify the object <<insert your object name here>>”.  When we receive this error message, We can just launch into Maintenance Run Mode (and get those magnets ready!)
HOW TO USAGE MAINTAINENCE RUN MODE
Click the drop down arrow next to the Run button and select Maintenance Run. The script will begin. When it cannot identify an object, the Maintenance Run Wizard opens (instead of the standard error message).
On the first screen QTP suggests 2 options:
  • Point to the Object
  • Add a Comment

Point to the Object : This will allow QTP to determine how to change the script to use that object.
Add a Comment:  This will not fix the script; just add a comment so we can address it later.
  • Click Point to the Object, the Application Under Test (AUT) opens
  • Point to the Object a hand icon – the Object Repository (O.R.) opens
  • Click OK – the Change the Property Value window opens. It reads, “The object you selected already exists in the O.R. but the description does not match.
  • Compare the properties
  • The attached text value in the O.R. = X
  • The value in the application = Y
  • At this point QTP lets us choose from 3 options:
  • Update the object description in the O.R.
  • Add a new object to the O.R. and update the step
  • Don’t make any changes, but add a comment before the step
  • Choose to update the object and continue.
The Maintenance Run Report shows the object was updated and the script continues.  There will be more details of the changes made by the Maintenance Run Wizard in the finished report. One thing to remember is that the changes that Maintenance Run Mode makes to your O. R. will only be reflected in the Local Object Repository.  If you utilize a Shared Object Repository, you can just copy the changes after they have been made.
When the attached property and the value in the O.R. are different, sometimes they can be fixed using a Regular Expression.
REGULAR EXPRESSION
When running in Maintenance Run mode, QTP cannot identify an object; the Maintenance Run Wizard opens (instead of the standard error message). If using a Regular Expression will help, the Maintenance Run Wizard offers to update the object using a Regular Expression.
Choose this option.
The Regular Expression will show in the script and in the O.R.
PARENT OBJECT ISSUES
When the attached property and the value in the O.R. are different, sometimes it isn’t an issue with the object itself, but with the Parent Object. When running in Maintenance Run mode, QTP cannot identify an object; the Maintenance Run Wizard opens (same as above).
The Wizard indicates the issue is with the Parent Object and shows the properties don’t match.
Choose Update the object description

No comments:

Post a Comment