Micro Focus QTP (UFT) Forums
How will you identify total number of buttons on SAP window. - 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 will you identify total number of buttons on SAP window. (/Thread-How-will-you-identify-total-number-of-buttons-on-SAP-window)



How will you identify total number of buttons on SAP window. - ketan.barbade@gmail.com - 02-03-2011

Hi All,

I jave one query.I need to identify total number of buttons on a particular window.If anybody is having the idea regarding the same,plz let me know.


RE: How will you identify total number of buttons on SAP window. - PrabhatN - 02-03-2011

Hi Ketan,

You can acheive it by creating Description object.

I have not done it on SAP, so posting the code for Web. You can customize the code and try on SAP

Quote:Set wButton = Description.Create

wButton("micclass").Value = "WebButton" //Here instead of micclass you can use any other property that SAP has for buttons and replace WebButton with the name QTP gives to SAP buttons

Set wButtonAll = Browser("BrowserName").Page("PageName").ChildObjects(wButton) //Makes list of all the buttons present under the hierarchy

Msgbox wButtonAll.Count //Give you the total number of buttons
Hope it will help you