Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6379577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:09:22+00:00 2026-05-25T02:09:22+00:00

I have a TestComplete test that selects a tab in a TTabSet using the

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:09:23+00:00Added an answer on May 25, 2026 at 2:09 am

    Instead of assigning a value to TabIndex, you can call TTabSet‘s ItemRect method to get the coordinates of a tab by its index, and then pass these coordinates to TestComplete’s Click method. Here’s an example:

    Sub Main
      Set tabSet = Sys.Process("Project1").VCLObject("Form1").VCLObject("TabSet1")
    
      For i = 0 To tabSet.Tabs.Count
        ClickTab tabSet, i
        Delay 1000
      Next
    End Sub
    
    Sub ClickTab(TTabSet, ItemIndex)
      Dim rect, x, y
      Set rect = TTabSet.ItemRect(ItemIndex)
      x = (rect.Left + rect.Right)  / 2
      y = (rect.Top  + rect.Bottom) / 2
    
      TTabSet.Click x, y 
    End Sub
    

    However, this approach requires that:

    • Your tested application is built with debug information (this makes public members, including ItemRect, available to TestComplete).
    • The application code contains the ItemRect method 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 the FirstIndex property:

    Sub ClickTab(TTabSet, ItemIndex)
      If ItemIndex >= TTabSet.FirstIndex + TTabSet.VisibleTabs Then
        TTabSet.FirstIndex = ItemIndex
      End If
    
      Dim index, rect, x, y
      index = ItemIndex - TTabSet.FirstIndex
    
      Set rect = TTabSet.ItemRect(index)
      x = (rect.Left + rect.Right)  \ 2
      y = (rect.Top  + rect.Bottom) \ 2
    
      TTabSet.Click x, y 
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem. I got a bat file that runs testcomplete test.
We are using TestComplete from AQTime to test the GUI at client with our
Have some dates in my local Oracle 11g database that are in this format:
I am using TestComplete 7. In this for configuration I have to post XML
Have a fun issue with sharepoint calendar view filtering. That code works fine: SPSecurity.RunWithElevatedPrivileges(delegate()
http://www.automatedqa.com/products/testcomplete/testing-qt-apps/ How would they have been able to do that? Is there a Qt
Have some code: using (var ctx = new testDataContext()) { var options = new
Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have a bunch of WCF REST services hosted on Azure that access a SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.