Forum Discussion

meenakshiyadav1's avatar
meenakshiyadav1
Contributor
6 years ago

ClickTab method is not working properly

I am using ClickTab method to click on desired Tab but at times it works correctly and other times it clicks on another tab.

when I spy on tabs.. it detects them as a single object called tab bar . I am using index of tab in click tab method.Please find the code below:

 

var TabBar = Aliases.browser.page.objvizexplorer.vizexplorer.ribbonmenu.tabbar;
TabBar.ClickTab(1)

 

Page has 4 tabs, I am using Focused Tab property to get the index of each tab.My desired tab's index is 1, even if I am  passing index as 1.. TC at times works correctly and other time it clicks on tab with index 2 or 0.

 

Please suggest what can be done.

1 Reply

  • sriram1's avatar
    sriram1
    Occasional Contributor

    Hi,

     

    In case of the tabs not getting selected using "Index" values. You can go for the "text" select. 

    For example. 

    In your case, 

    var TabBar = Aliases.browser.page.objvizexplorer.vizexplorer.ribbonmenu.tabbar;
    ##TabBar.ClickTab(1)  ### Instead of giving the index values give the tab names

    TabBar.ClickTab("TestTab")

     

    Sure it will work. 

     

    Thanks and Regards,

    Sriram