Micro Focus QTP (UFT) Forums

Full Version: Identifying Objects on any screem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
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.
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
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?