I have a TestComplete test that selects a tab in a TTabSet using the TabIndex property:
Tab.TabIndex = 1
That works great. However, I am noticing that some of the objects on that tab require the click event to occur to be enabled. That said, how can I select the tab item via the TabIndex with some sort of a click event involved?
Instead of assigning a value to
TabIndex, you can callTTabSet‘sItemRectmethod to get the coordinates of a tab by its index, and then pass these coordinates to TestComplete’sClickmethod. Here’s an example:However, this approach requires that:
ItemRect, available to TestComplete).ItemRectmethod call (otherwise this method will be left out of the EXE by Delphi’s smart linker, so it will be unavailable to TestComplete).Also, if your tab control has more tabs than are displayed (that is,
Tabs.Count>VisibleTabs), you’ll need to scroll it to make the needed tab visible first. You can do this, for example, using theFirstIndexproperty: