New to Telerik Test Studio? Download free 30-day trial

Merge Page Nodes

Page Nodes

The default for the Compare Mode in Project Settings > Recording is FullPathAndQuery. Depending on your application, this can cause duplication in the Elements Explorer. Although the page node is not used to locate an element during execution, it's best to consolidate duplicate page nodes for organizational and maintenance purposes. For example:

  1. Navigate to http://www.bing.com/?123

  2. Enter text into the query box.

  3. Click the Search button.

  4. Notice the Elements Explorer.

    Element explorer with one page node

  5. Navigate to http://www.bing.com/?456

  6. Repeat steps 2 and 3.

  7. Notice the Elements Explorer.

  8. The SbFormQText and SbFormGoSubmit elements are duplicated under each page node. This should not cause an Unable to locate element failure during execution, however it can make for unnecessary maintenance and disorganization in your project.

    Element explorer with two page node

  9. To prevent duplication moving forward, change the Compare Mode to FullPath.

    Compare mode

  10. To merge the existing duplicates, highlight each page and change its CompareMode property to FullPath.

    Change compare mode

    Select node

  11. Elements explorer refreshes automatically and the nodes merge, the tree structure is better organized, and any maintenance needed on an element can now be done in one place.

    Nodes merge

If FullPath is not applicable to your project, review the Project Settings > Recording Options page and select the Compare Mode that best suits your needs.

Frames

An element directly under a page node is located entirely by its Find Settings. Conversely, an element within a frame must be located via the frame first.

  1. Here we see a similar situation due to dynamic frame IDs.

    Two frame nodes

  2. To merge duplicate frame nodes caused by dynamic frame IDs, strip the dynamic portion from each ID and use a tilde (~) to indicate a partial match. See this page for more information on frames.

    New ID

  3. Click Refresh to merge the duplicates.

    Merge nodes

SilverlightApps

Like frames, an element within a SilverlightApp must be located via the SilverlightApp first. Unlike a frame node, a SilverlightApp node has Find Settings just like a regular element, which can be changed via the Find Element dialog.

SL find properties

SL application

In this article