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.

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: 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: 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: 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: 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.

Reviewing Smart Identification Information in the Test Results

If the learned description does not enable QuickTest to identify a specified object in a step, and a Smart Identification definition is defined (and enabled) for the object, then QuickTest tries to identify the object using the Smart Identification mechanism.

If QuickTest successfully uses Smart Identification to find an object after no object matches the learned description, the Test Results receive a warning status and indicate that the Smart Identification mechanism was used.

If the Smart Identification mechanism cannot successfully identify the object, QuickTest uses the learned description plus the ordinal identifier to identify the object. If the object is still not identified, the component fails and a normal failed step is displayed in the results.

Smart Identification Process

If QuickTest activates the Smart Identification mechanism during a run session (because it was unable to identify an object based on its learned description), it follows the following process to identify the object:

  1. QuickTest "forgets" the learned test object description and creates a new object candidate list containing the objects (within the object's parent object) that match all of the properties defined in the Base Filter Properties list.
  2. QuickTest filters out any object in the object candidate list that does not match the first property listed in the Optional Filter Properties list. The remaining objects become the new object candidate list.
  3. QuickTest evaluates the new object candidate list:
    • If the new object candidate list still has more than one object, QuickTest uses the new (smaller) object candidate list to repeat step 2 for the next optional filter property in the list.
    • If the new object candidate list is empty, QuickTest ignores this optional filter property, returns to the previous object candidate list, and repeats step 2 for the next optional filter property in the list.
    • If the object candidate list contains exactly one object, then QuickTest concludes that it has identified the object and performs the statement containing the object.
  4. QuickTest continues the process described in steps 2 and 3 until it either identifies one object, or runs out of optional filter properties to use.

If, after completing the Smart Identification elimination process, QuickTest still cannot identify the object, then QuickTest uses the learned description plus the ordinal identifier to identify the object.

If the combined learned description and ordinal identifier are not sufficient to identify the object, then QuickTest stops the run session and displays a Run Error message.

Configuring Smart Identification

When QuickTest uses the learned description to identify an object, it searches for an object that matches all of the property values in the description. In most cases, this description is the simplest way to identify the object, and, unless the main properties of the object change, this method will work.

If QuickTest is unable to find any object that matches the learned object description, or if it finds more than one object that fits the description, then QuickTest ignores the learned description, and uses the Smart Identification mechanism to try to identify the object.

While the Smart Identification mechanism is more complex, it is more flexible. Therefore, if configured logically, a Smart Identification definition can probably help QuickTest identify an object, if it is present, even when the learned description fails.

The Smart Identification mechanism uses two types of properties:

  • Base Filter Properties—The most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link's tag was changed from <A> to any other value, you could no longer call it the same object.
  • Optional Filter Properties—Other properties that can help identify objects of a particular class. These properties are unlikely to change on a regular basis, but can be ignored if they are no longer applicable.

Smart Identification in QTP

Selecting the Enable Smart Identification check box for a particular test object class instructs QuickTest to learn the property values of all properties specified as the object's base and/or optional filter properties in the Smart Identification Properties dialog box.

By default, some test objects already have Smart Identification configurations and others do not. Those with default configurations also have the Enable Smart Identification check box selected by default.

You should enable the Smart Identification mechanism only for test object classes that have defined Smart Identification configuration. However, even if you define a Smart Identification configuration for a test object class, you may not always want to learn the Smart Identification property values. If you do not want to learn the Smart Identification properties, clear the Enable Smart Identification check box.

Note: Even if you choose to learn Smart Identification properties for an object, you can disable use of the Smart Identification mechanism for a specific object in the Object Properties or Object Repository dialog box.

However, if you do not learn Smart Identification properties, you cannot enable the Smart Identification mechanism for an object later.

Improving QuickTest Performance

Q: How can I improve the working speed of QuickTest?

You can improve the working speed of QuickTest by doing any of the following:

  • Do not load unnecessary add-ins in the Add-in Manager when QuickTest starts. This will improve both recording time and run session performance. For more information about loading add-ins.
  • Run your components in "fast mode." From the Run tab in the Options dialog box, select the Fast option. This instructs QuickTest to run your test without displaying the execution arrow for each step, enabling the test to run faster.

Component Maintenance Query

Q: How do I maintain my component when my application changes?

The way to maintain a component when your application changes depends on how much your application changes. This is one of the main reasons you should create a small group of components rather than one large component for your entire application. When your application changes, you can re-record part of a component. If the change is not significant, you can manually edit a component to update it.

If you have many components that contain the same test objects, it is recommended to work with shared object repositories so that you can update object information in a centralized location.

To update the information about your test object properties when object properties change, use the Update Run Mode option.

Advanced Web Issues Questions

Q : How does QuickTest handle cookies?

Server side connections, such as CGI scripts, can use cookies both to store and retrieve information on the client side of the connection.

QuickTest stores cookies in the memory for each user, and the browser handles them as it normally would.

Q : How does QuickTest handle session IDs?

The server, not the browser, handles session IDs, usually by a cookie or by embedding the session ID in all links. This does not affect QuickTest.

Q : How does QuickTest handle server redirections?

When the server redirects the client, the client generally does not notice the redirection, and misdirections generally do not occur. In most cases, the client is redirected to another script on the server. This additional script produces the HTML code for the subsequent page to be viewed. This has no effect on QuickTest or the browser.

Q : How does QuickTest handle meta tags?

Meta tags do not affect how the page is displayed. Generally, they contain information only about who created the page, how often it is updated, what the page is about, and which keywords represent the page's content. Therefore, QuickTest has no problem handling meta tags.

Q : Does QuickTest work with .asp?

Dynamically created Web pages utilizing Active Server Page technology have an .asp extension. This technology is completely server-side and has no bearing on QuickTest.

Q : Does QuickTest work with COM?

QuickTest complies with the COM standard.

QuickTest supports COM objects embedded in Web pages (which are currently accessible only using Microsoft Internet Explorer) and you can drive COM objects in VBScript.

Q : Does QuickTest work with XML?

XML is eXtensible Markup Language, a pared-down version of SGML for Web documents, that enables Web designers to create their own customized tags. QuickTest supports XML and recognizes XML tags as objects.