Showing posts with label Run Time Errors. Show all posts
Showing posts with label Run Time Errors. Show all posts

Tuesday, 18 December 2012

Run Error: Cannot identify object??

This error indicates that there is no object in the current view of the application that matches the description saved in the object repository for the object.
This error occurs in one of two basic situations:
  • The object is not (or not yet) displayed in the application at the time of the error.
  • The object is present, but the description in your application has changed so that it no longer matches the test object description that QuickTest is using to identify the object.

Run Error: The object is not unique


More than one object within the specified parent object has the same property values as those specified in the test object description for this object.
Determine whether the problem is with an individual object in your application, or whether the same problems apply to all or many of the objects in your application with the same object class.

Run Error: Parent not found

Each object in your component is identified relative to its parent objects.
If you received a Parent not found message, try one of the following solutions:
  • Fix the object description of the problematic parent object using the suggestions below
    • If you find that an object in your component has one or more property values in its description that differs from the corresponding object property in your application, determine whether the problem is with an individual object in your application, or whether the same problems apply to all or many of the objects in your application with the same object class.
  • Find all instances of the old hierarchy in the Expert View and replace it with the correct object hierarchy as described below

Re-recording an Object to Identify Parent Object Description Problems

Follow the instructions below to identify a problem with a parent object.
To identify a problem with a parent object by re-recording the child object:
  1. Open your browser or application to the page containing the object that caused the error.
  2. Select the last step in the component in the Keyword View or place the cursor below the last statement in the Expert View.
  3. Click the Record button or choose Automation > Record.
  4. Click or perform another operation on the object.
  5. Click the Stop button or choose Automation > Stop.
  6. Right-click the new step and select Object Properties.
  7. In the Object Properties dialog box, click Repository. The Object Repository opens with the new object selected. Note the parent hierarchy of the new object.
  8. Find the old (problematic) object in the Object Repository and compare the parent hierarchy of the old object with that of the new object.
Check to see whether the differences are due to one or more parent objects with different descriptions, or whether the actual objects in the parent hierarchy are different.
    • If you find a problem with a parent description, try to fix it using the suggestions for Solving Object Description Problems.
    • If the problem stems from a different set of parent objects in the hierarchy, find all instances of the old hierarchy and replace it with the new object hierarchy as described in the example below.
Example:
Suppose that on a Web site with frames, you recorded a step on an Image object named Poster. In the Object Repository window, you can see that Image object's hierarchy is similar to the following (the object class is listed in parentheses for this example):
MyCompany (Browser)
MyCompany (Page)
Main (Frame)
Poster (Image)
When you later run the component, the Web page looks the same, but you receive a Cannot Identify Object error for the Poster image. When you re-record the step and view the Image object in the Object Repository window, the hierarchy might look like this:
MyCompany (Browser)
MyCompany (Page)
Poster (Image)
Now you can see that the frames have been removed from the Web page, so even though the Poster image still has the same object description, its parent hierarchy is different.
In the object repository, you can see that there are actually two different poster objects: the old one under the obsolete Frame object, and the new one directly under the MyCompany page.
To fix the problem, you can replace the object in the step by clicking Select another object and choosing the required object from the correct location in the hierarchy (tree).
To keep your Object Repository well-organized, you should also delete the obsolete objects from the Object Repository by right-clicking the obsolete object and selecting Delete.

Run Error: Cannot identify item


QuickTest cannot identify a list or tree item specified in a method argument.
Confirm that the specified item exists in the object.
  • If the object does not exist, delete the step or modify the item on which you want to perform the step.
  • If the item exists, its name may have changed. Modify the name as necessary or specify the item using the item's index (for example, "#4"). Note that different test objects and methods may use a different syntax for specifying an item's index.

Run Error: The object's item is not unique


Q: Why this error occurs??
More than one item in a list or tree item has the name specified in the method argument.
Specify the item using the item's index (for example, "#4"). Note that different test objects and methods may use a different syntax for specifying an item's index.

Run Error: Test run failed


Q: Run Error: Test run failed
The run session cannot continue due to an unknown error. Check the step where the failure occurred.
If your component failed while referring to an external file, such as an associated function library, check that the files are accessible from your computer and that the files are saved in the appropriate format.
If your component failed while performing a QuickTest step in a function, refer to the QuickTest Object Model Reference for more information on appropriate usage of the function in your statement.
If your component failed while performing a standard VBScript step in a function, refer to the Microsoft VBScript Reference.

How to use Watch in QTP?


You can view the current value of any variable or VBScript object in your function library by adding it to the Watch tab. As you continue stepping into the subsequent steps in your function library, QuickTest automatically updates the Watch tab with the current value for any object or variable whose value changes. You can also change the value of the variable manually when the function library pauses at a breakpoint.
To add an expression to the Watch tab:
Perform one of the following:
  • Click the expression and choose Debug > Add to Watch
  • Click the expression and press Ctrl+T
  • Right-click the expression and choose Add to Watch from the context menu
  • In the Watch tab, paste or type the name of the object or variable into the Name column and press Enter to view the current value in the Value column
Note: You can add an expression to the Watch tab from a function library (and not from a business component).
Tip: You can also use the Variables tab to view the current values for all variables up to the current step in the function library.

Handling Run Errors in QTP

The Run Error message box displayed during a run session offers a number of buttons for dealing with errors encountered:

  • Stop—Stops the run session.
    The run results are displayed if QuickTest is configured to show run results after the run.
  • Retry—QuickTest attempts to perform the step again.
    If the step succeeds, the run continues.
  • Skip—QuickTest skips the step that caused the error, and continues the run from the next step.
  • Debug—QuickTest suspends the run, enabling you to debug the component and any associated function library that contains a function called by the component.
You can perform any of the debugging operations described in this section. After debugging, you can continue the run session from the step where the component or function library stopped, or you can use the step commands to control the remainder of the run session.
  • Help—Opens the QuickTest troubleshooting Help for the displayed error message. After you review the Help topic, you can select another button in the error message box.
  • Details—Expands the message box to display additional information about the error.