Micro Focus QTP (UFT) Forums
How to validate Tab names and child tab names in QTP - 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: How to validate Tab names and child tab names in QTP (/Thread-How-to-validate-Tab-names-and-child-tab-names-in-QTP)



How to validate Tab names and child tab names in QTP - iamsekhar - 07-30-2010

Hi,
I want to validate tab

Scenario:
1. After launching my application, it should foucs to some (eg.Summary) tab name and child tab name (eg.Data Summary)

2. I want to validate whether these two tabs (Summary and Data Summary) are focused or not?

3. How get tab name (eg. Summary) on which property i have to used to get name.

I will appreciate your help,
Kindly advise...


RE: How to validate Tab names and child tab names in QTP - PrabhatN - 07-30-2010

Hi Sekhar,

You can make use of "selection" property of Tab control. It retains the name of the Tab that is currently selected.

In your application, there are two Tab controls i.e parent and child. After lunching your application retrieve the value of the "selection" property for both the Tab controls and check if they are the expected ones (i.e. Summary and Data Summary) or not.

Hope it will help you..


RE: How to validate Tab names and child tab names in QTP - iamsekhar - 08-02-2010

Hi PrabhatN, thanks for your great reply and i am new to QTP, as per your reply how to get value of the "selection". If you dont mind can you please explain in details.

I am providing script to you for better understanding. I am trying GetProperty with different values as given below. Please correct me if i am doing wrong?

Code:
SwfWindow("Lilly Science Grid").SwfTab("LSB_OCT_Workspace").Select "Summary"   // Focus

sumTabName = SwfWindow("Lilly Science Grid").SwfTab("LSB_OCT_Workspace").GetROProperty("name")  
msgbox sumTabName   -- i am getting output like that this name :"LSB_OCT_Workspace"

sumTabName1 = SwfWindow("Lilly Science Grid").SwfTab("LSB_OCT_Workspace").GetROProperty("value")
msgbox sumTabName2   -- i am getting output like blank message box.

sumTabName2 = SwfWindow("Lilly Science Grid").SwfTab("LSB_OCT_Workspace").GetROProperty("text")
msgbox sumTabName1   -- i am getting output like blank message box.
Chandra Sekhar



RE: How to validate Tab names and child tab names in QTP - PrabhatN - 08-02-2010

Hi Sekhar,

Try this,
Code:
SwfWindow("Lilly Science Grid").SwfTab("LSB_OCT_Workspace").Select "Summary"

getSelTab = SwfWindow("Lilly Science Grid").SwfTab("LSB_OCT_Workspace").GetROProperty("selection")

Now getSelTab will have the name of the Tab i.e. currently selected

Actually I tried this with Windows application and it worked. Hope it works with your application too.


RE: How to validate Tab names and child tab names in QTP - iamsekhar - 08-04-2010

Hi Prabhat,
I tried as per you, it was working and able to get root and child tab names.
I really appreciate your help and also thankful to this fourm providing such a great support.
Sekhar