1
votes

How to identify an object, using OR or DP, with a native property?

I'm aware about "attribute/property" for Web objects, but my application is standalone.

I'm deliberately not posting any more details, because I need an answer to a question itself, and not the possible solution to my particular problem.

Thank you.

3
Can you provide us the language your application is written in and which QTP add-ins you are using? And what does the Object Spy display if you spy an object, are there any properties displayed? - AutomatedChaos
Is the answer different for different technologies, except for web? - Andrey

3 Answers

0
votes

An approach might be to get all child objects and then check for the native property to get the desired object.

Set oDesc=Description.Create()
oDesc("micclass").Value="Link"
oDesc("innertext").Value="Go To"
Set linkCollection=Browser("title:=.*").Page("title:=.*").ChildObjects(oDesc)
For i=0 to linkCollection.Count
    nativePropertyVal = linkCollection(i).Object.sourceindex 'Use the native property in place of sourceindex
    If StrComp(nativePropertyVal,"7")=0 Then 'Compare the native property value you want to use
       linkCollection(i).click
    End If
Next
0
votes

The actual answer I was looking for is to define a custom property with the same name as the desired native property in the Object Identification menu. This will move the property from Native to Test.

0
votes

There are no non-Native property as such, Native properties are developer defined for the object in the application which are internally do some task wih underlying layers of application. you can however define your own property using OR option which will work during run time.