Micro Focus QTP (UFT) Forums
Identifying Objects on any screem - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Identifying Objects on any screem (/Thread-Identifying-Objects-on-any-screem)



Identifying Objects on any screem - dipti.pasricha - 05-22-2012

Hi,
I need to create a QTP script which identifies all the objects say buttons, drop down etc. on any screen and validates them.
It should be a reusable script.

Can anyone help on this.

Thanks, Dipti


RE: Identifying Objects on any screem - Arul - 05-22-2012

Hi dipti,
try like this For Button:

Code:
Class ButtonClass

Funcion Webbutton("Logicalname",ObjectName,WaitTime)
Set objButton=Browser("Google").Page("Google")
If objButton.Exist(WaitTime) Then
ObjectName.Click
End If
Set objButton=Nothing
End Function

End Class

ButtonClass.Webbutton "Submit",Browser("Google").Page("Google").Webbutton("Submit"),10




Regards,
Arul


RE: Identifying Objects on any screem - Shridevi.Salagare - 05-22-2012

For one of my project I had a similar scenario to work.
We had created a function which will take - type of object(swfbutton),name of object (Name) and the object path(.SWfwindow("Main"))

And then inside function we can put a switch statement and perfom whatever operation we have to perform.

This is one time effort but this function we can reuse multiple times and it was really useful.

Please revert back if you have any query regarding this.


RE: Identifying Objects on any screem - dipti.pasricha - 05-29-2012

Thanks Shridevi.

It would be great help, if you could mail or post the function code.
Atleast i would get some idea.
In my project i need to capture all the elements on any opened screen and then validate them.

mailid: dipti.pasricha@gmail.com

Regards,
Dipti


RE: Identifying Objects on any screem - supputuri - 05-29-2012

HI Dipti,

we can capture the elements using the childobjects but I need some more clarification on the validation part. What do you mean by validate? What type of validation?