Delphi application tab selection where Visible set to False
I have a Delphi application with multiple tabs available for selection via the UI.
When opening the application for the first time TestComplete object browser can only identify the default tab that is selected and the parent form only has one child. When I click on the other tabs the object browser will then identify the other tabs and the ChildCount goes up accordingly, meaning the tab names are only generated at runtime.
The currently selected tab property Visible is True and all the other ones are False. When I use ClickTab I get the error "The tab control is invisible and thus cannot be activated." The WndClass property of each tab is TRzTabSheet. The code looks like:
TestObj.ClickTab(2)
Even when I specify the correct Index (such as 2 in the above code) on the selected tab it returns the error "The tab control page's index 2 is out of bounds."
Currently the only way I have been able to switch between tabs is using screen coordinates, which is not ideal. Has anyone got any suggestions as to how to switch between tabs in a Delphi app such as this?
Thanks.