namePropStr Property (Web and XUL Objects)

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

The namePropStr property returns the last component of the URL contained in the object’s href or src attribute. Typically, this is a file or page name specified in the URL.

This property has only a value for web link and image objects (HTML A and IMG elements, respectively). For other object types, the property value is empty.

Declaration

TestObj.namePropStr

Read-Only Property String
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Property Value

A string containing the last component of the URL held in the object’s href or src attribute. If the URL includes a query string or an anchor part, they are included in the returned value. For example:

href or src value namePropStr value
http://www.example.com http://www.example.com
http://www.example.com/file.pdf file.pdf
http://www.example.com/GetFile.aspx?guid=5d2240a9-3859-4ab7-a94c-20c422e4e9ac GetFile.aspx?guid=5d2240a9-3859-4ab7-a94c-20c422e4e9ac
http://www.example.com/products/muchomoney.aspx#features muchomoney.aspx#features
http://www.example.com/products/muchomoney/#features #features

If the object does not have the href or src attribute or if they are empty, namePropStr returns an empty string.

Remarks

This property is available only if the Tree model of web objects is active.

See Also

idStr Property (Web and XUL Objects)
Classic Web Testing

Highlight search results