Working With Tab Hosts - Basic Concepts

Applies to TestComplete 15.63, last modified on April 23, 2024
General Notes

TestComplete recognizes tab host controls in Android Open Applications. Tab host controls are associated with the Android TabHost test objects that contain specific methods for simulating user actions and for obtaining the control’s data.

Specifics of Working With TabHost Contents

Android tab host object is a container for a tabbed window view. Here is a sample view of the TabHost object and its child objects in the Object Browser:

The TabHost object has the following child objects:

  • TabWidget that is a collection of tabs, and

  • Layout that contains test objects corresponding to controls located on tabbed pages.

Quite often, in the object hierarchy, TabWidget is not the direct child of the TabHost object, but is placed within another object like HorizontalScrollView or VerticalScrollView, which is a direct child of TabHost. These intermediate scroll view objects are used for managing the tab layout.

To work with individual tabs, for instance, to select a tab, you can call some methods or property of child objects of TabWidget. However, in most cases, it is easier and simpler to use methods and properties of TabHost objects for this purpose, as this hides the details of control implementation from tests. For information on typical operations that you can perform on the tabs, see other topics of the Working With Android Tab Host Controls section.

If you need to work with controls that are located on tabbed pages, use child objects of the TabHost(...).Layout(...) object. Note that the controls that are not on the focused page have their Visible and VisibleOnScreen properties set to False. That is, you cannot simulate user actions on them directly, you need to make their tabbed pages active first. However, you can obtain their properties in your tests.

See Also

Working With Android Tab Host Controls
Determining the Current Tab Page
TouchTab Method (Mobile Controls)
LongTouchTab Method (Specific to Android TabHost Controls)

Highlight search results