Visual Relation Identifiers (VRI) option does not work if XPath is defined

An object is learned inside a web page and is used as a template for another web page. For identifying the object, Visual Relation Identifiers properties are applied.

Trying to recognize the object in the second web application fails. The objects needs to be updated, then the description does not work on the first application.

Visual Relation Identifiers do not work if the following option is set:

Options -> Web -> Advance -> Learn and Run using automatic XPath identifiers.

This option is checked by default. The auto XPath is not visible by design since it is an automatically generated property.

There is an issue with VRI (Visual Relation Identifiers) in cases where a learned object is used as a ‘template’ and then the specific object is identified by changing the VRI setting (or the object indexer). Since the check for matching an element to XPath is done before VRI (or indexer), the web agent will always return the original element and the VRI settings will not match (or the indexer will be ignored).

To resolve this problem, disable XPath:

1. Go to Options -> Web -> Advance

2. Clear the Learn and Run using automatic XPath identifiers option.

Another solution:

For specifying a user defined XPath there is the XPath property that will override the automatically generated one. Add the _path property to the object in the Object Repository and leave it empty. This will rewrite the value in the options settings.

For documentation regarding auto XPath see:

• HP QuickTest Professional Add-ins Guide > Overview > Testing Web-Based Applications > Understanding Web Object Identifiers > Web Object Identifier Types

• HP QuickTest Professional Add-ins Guide > Overview > Testing Web-Based Applications > Understanding Web Object Identifiers > Considerations for Working with Web Object Identifiers

Advertisements

One thought on “Visual Relation Identifiers (VRI) option does not work if XPath is defined

  1. Rizz

    Nice article Abdul, I”m just curious though, can this be used for descriptive programming or is this only dealing with the object repository?

    Thanks

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s