Forum Discussion

yuga_mannava's avatar
yuga_mannava
New Contributor
13 years ago

CTabfolder control problem in Testcomplete

Hi *,

Till now i was working on java swing objects and i didn't find any problem with them while working with JTabbedpane.



Recently i started testing on eclipse and i got a problem to open a tab (on CTabFolder) based on the tab text.

how can we click on the tab with specific text on tab?



code sample will help me more...

3 Replies


  • Hi Yugandhar,


     


    We have posted an example of how to work with the CTabFolder control. Here is the example:


    //JScript

    function Test()


    {   


      var obj = Sys.Process("Process").SWTObject("Shell", "Application").SWTObject("Composite", "", 5).SWTObject("Composite", "").SWTObject("CTabFolder", "", 6);


      


      ClickTab(obj, "Tab 2");                   


    }


     


    function ClickTab(objCTabFolder, strTabName)


    {         


      count = objCTabFolder.getItemCount(); 


     


      for (var i = 0; i < count; i++)


      {


          TabItem = objCTabFolder.getItem(i);


          


          if (TabItem.text == strTabName)


          {         


            objCTabFolder.Click(TabItem.x, TabItem.y);


          }


      }     


    }


     


  • Dear Tanya,



    Yes it is very Helpful and fulfilled my task.



    The only thing i need to know now is how to get the underlying object in the current tab.



    i.e. in each tab, which control item is present and what is index for that control item.



  • Hi Yugandhar,


     


    After opening a tab, all objects should be seen in TestComplete's Object Browser. So, you can just record a test to perform the needed actions on this tab.


     


    BTW, if my previous reply way useful for you, you can vote for it :)  (by clicking Yes next to "Was this post helpful?").