| || |
Descriptive programming to identify an object
Can you please help me understand the below?
Whilst using descriptive programming to identify an object of type Link, QTP could not identify that particular object:
- Error message: “Cannot identify the object "[Link]" (of class Link). Verify that this object's properties match an object currently displayed in your application.”
Upon doing a spy of the object’s descriptive properties, the object does not appear to have a class value. I found objects of type Link with a class value were being identified by the regression pack but an object of type Link without a class value were not being identified! We have used a number of descriptive properties in order to identify the object. All failed with the same error message.
My question is this, do ALL objects have to have a class value when using descriptive programming? If this answer is No and the object is not being identified is there any known workaround?
Re: Descriptive programming to identify an object
I am not sure if an object have to have class value. But try doing something like this
Set oDesc = Description.Create ()
oDesc("Property1").value = value1
oDesc("Property2").value = value2
oDesc("Property3").value = value3
Set oList = Browser("B").Page("P").ChildObject(oDesc)
If oList.Count > -1 Then
For i = 0 to oList.Count - 1
msgBox "There is no object in GUI which matches current description"
' Use innertext, html tag , name properties to find these links