Micro Focus QTP (UFT) Forums
Select SAPGUITab - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Select SAPGUITab (/Thread-Select-SAPGUITab)



Select SAPGUITab - manishnangalia - 10-17-2012

Need to select a SAPGUITabStrip via descriptive programming, can anyone help urgently


RE: Select SAPGUITab - Ankesh - 10-17-2012

what have you tried?? are u facing any issue?


RE: Select SAPGUITab - manishnangalia - 10-18-2012

Actually the problem is there is a SAPGUITable inside the Tab so the Tab name is like the Tab name (No. of row in the table)
For eg. if the total no. of rows in the table is 26, so its Tab name(26)
So its changing dynamically, so how can i click that tab,
I used descriptive programming like
Code:
'SAPGuiSession("Session").SAPGuiWindow("Maintain Business Partner").SAPGuiTabStrip("GS_SCREEN_1200_TABSTRIP").Select "name := Tab_02"
but that does not work, so what else i can try.


RE: Select SAPGUITab - Ankesh - 10-22-2012

do u know the total rowcount becfore selecting the tab?

Regards,
Ankesh


RE: Select SAPGUITab - manishnangalia - 10-22-2012

No, that is what the main problem is


RE: Select SAPGUITab - Ankesh - 10-23-2012

Try the below code. This is just a sample code, modify as per your need.

Code:
strAllItems=SAPGuiSession("micClass:=SAPGuiSession").SAPGuiWindow("micClass:=SAPGuiWindow").SAPGuiTabStrip("micClass:=SAPGuiTabStrip","name:=TAXI_TABSTRIP_OVERVIEW").GetROProperty("allitems") '//Just update the tabe name here
arrTabsName=Split(strAllItems,";")' split and get tabs name in array
'iterate through all tabs
For i=0 to Ubound(arrTabsName)
  If Instr(arrTabsName(i),"<Part of tab name which is fixed")>0Then
        SAPGuiSession("micClass:=SAPGuiSession").SAPGuiWindow("micClass:=SAPGuiWindow").SAPGuiTabStrip("micClass:=SAPGuiTabStrip","name:=TAXI_TABSTRIP_OVERVIEW").Select arrTabsName(i)
        Exit For
    End If
Next

Regards,
Ankesh