Version

xamTabControl - Replay-Only Methods

Topic Overview

Purpose

This topic provides reference information about the replay-only user methods for testing the XamTabControl™.

xamTabControl Test Object Replay-Only Methods

Replay-only methods summary chart

The following table briefly explains the replay-only methods for testing the control. Detailed information about the methods is provided below the table.

Method Description

Returns True if the specified tab is enabled.

Returns the selected tab header text as string value*.*

Returns the number of tabs.

Returns the header of the specified tab as a string value.

Returns a new line-delimited list of tabs’ headers.

IsTabEnabled

Description

The IsTabEnabled method returns True if the specified tab is enabled.

Details

The method accepts as a parameter either the tab header text or the tab index. Using the tab index is necessary when the header text of the specified tab is not unique.

Parameters

The following table explains the method’s parameters together with some sample code.

Method Parameter Description

Tab header text

Using the tab header text as a parameter.

Example

Checking if the first tab with header “Tab1” is enabled to close it:

If WpfWindow("MainWindow").XamTabControl("xamTabControl1").IsTabEnabled("Tab1")=True Then

WpfWindow("MainWindow").XamTabControl("xamTabControl1").CloseTab "Tab1"

End If

tab index

Using the tab index as a parameter.

Example

Checking if the first tab with index 0 is enabled to close it:

If WpfWindow("MainWindow").XamTabControl("xamTabControl1").IsTabEnabled(0)=True Then

WpfWindow("MainWindow").XamTabControl("xamTabControl1").CloseTab 0

End If

Default setting

No default settings.

Possible exceptions

The following table lists the possible exceptions for the method and the reason that is likely causing them.

Exception name Exception description Possible reasons

The following item was not found.

The selected tab cannot be located when replaying the method.

  • The tab has been closed already.

  • The tab doesn’t exist.

GetSelection

Description

The GetSelection method returns the selected tab header as string value.

Details

No additional details.

Parameters

No parameters are used with this method.

Example

Display a message box with the header of the selected tab:

msgbox(WpfWindow("MainWindow").XamTabControl("xamTabControl1").GetSelection())

Default setting

No default settings.

Possible exceptions

No known exceptions.

GetItemsCount

Description

The GetItemsCount method returns the number of tabs.

Details

When used without parameter, only visible tabs are counted. Including the hidden tabs in the count, requires using the True parameter.

Parameters

The following table explains the method’s parameters together with some sample code.

Method Parameter Description

True

Returns both the visible and the hidden tabs count.

Example

Displaying a message box with the total number of the tabs (visible and hidden):

msgbox(WpfWindow("MainWindow").XamTabControl("xamTabControl1").GetItemsCount(True))

None

Returns only the visible tabs count.

Example

Displaying a message box with the number of visible tabs:

msgbox(WpfWindow("MainWindow").XamTabControl("xamTabControl1").GetItemsCount())

Default setting

No default settings.

Possible exceptions

No known exceptions.

GetItem

Description

The GetItem returns the header of the specified tab as a string value.

Details

The method accepts as a parameter the tab index number.

Parameters

The following table explains the method’s parameters together with some sample code.

Method Parameter Description

tab index

Returns the header of the specified tab as a string value.

Example

Displaying a message box with the header of the tab with index 4:

msgbox(WpfWindow("MainWindow").XamTabControl("xamTabControl1").GetItem(4))

Default setting

No default settings.

Possible exceptions

The following table lists the possible exceptions for the method and the reason that is likely causing them.

Exception name Exception description Possible reasons

The specified index is out of range.

The tab indicated by the index cannot be found.

  • an invalid index has been specified

GetContent

Description

The GetContent method returns a new-line-delimited list of the texts of the tabs’ headers.

Details

When used without parameter, only the header texts of the visible tabs are listed. Including the header texts of the hidden tabs in the list requires using the True parameter.

Parameters

The following table explains the method’s parameters together with some sample code.

Method Parameter Description

True

Lists both the visible and the hidden tabs.

Example

Displaying a message box listing the header texts of all (visible and hidden) tabs:

msgbox(WpfWindow("MainWindow").XamTabControl("xamTabControl1").GetContent(True))

None

Lists only the visible tabs.

Example

Displaying a message box listing the header texts of the visible tabs:

msgbox(WpfWindow("MainWindow").XamTabControl("xamTabControl1").GetContent())

Default setting

No default settings.

Possible exceptions

No known exceptions.

Related Content

Topics

The following table lists other topics you may find useful.

Topic Purpose

This topic provides information about the user actions of the xamTabControl™ which you can test and the elements you can inspect.

This topic provides reference information about the recordable user methods for testing the xamTabControl™.

This topic provides reference information about the inspectable test object properties of the xamTabControl™.

This topic provides reference information about the proxy class that supports the testing of the xamTabControl™ in Micro Focus Unified Functional Testing software.