Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Child Objects
#1
Solved: 11 Years, 2 Months, 4 Weeks ago
Hi,

I am attempting to create a collection of objects that should enable me to click an arrow image on a drop down list.

In the past I simply did this by:
Code:
Set bDesc = Description.Create()
         bDesc("micclass").Value = "Image"
         bDesc("name").Value = "Image"
Set  ImgCollect = Browser("browswer").Page("page").Webtable("webtable").ChildObjects(bDesc)

AND SO ON....

I am seeing now that the IMAGE that I clicked in the past is now actually 2 webtables deep.

Meaning if I spy on this image that I want to click, I see:
--Browser
----Page
-----Webtable
-------Webtable
-----------Image

Where before - and like in the beginning of my commment it was simply:
--Browser
----Page
-----Webtable
---------Image

I tried this:
Code:
Browser("browser").Page("page").Webtable("webtable").Webtable("webtable").childobjects(bdesc)

QTP does not like this and gives me a general runtime error. Does anyone know a way I can get around this? And click this?

Thanks,
Charles
Reply
#2
Solved: 11 Years, 2 Months, 4 Weeks ago
You could try not using Webtables and just get all the ChildObjects of the page.

Code:
rowser("browser").Page("page").ChildObjects(bdesc)

that should be able to get the image anywhere on the page regardless of surrounding tables/tags.

PS. You can't use the name description. Try html id and tag. Name only exists in the Object repository not in the page code and can not be used with DP, unless it's been specifically added by the developers which doesn't usually happen.
Reply
#3
Solved: 11 Years, 2 Months, 4 Weeks ago
Yes, bDesc("name").Value = "Image" >> If this is the one developers used in their code, then we have to use the property name which has the unique value for that object, say for example html id.
Else QTP fails to identify the object as multiple objects will have the same property value.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Child Object Not able to identified in Web Menu Link noor 0 1,862 01-21-2018, 04:44 PM
Last Post: noor
  Selecting child node from Wintree object ajith123 2 5,322 02-26-2014, 02:12 AM
Last Post: supputuri
  Child Objects in JavaWindow shubham 0 2,942 01-24-2014, 03:21 AM
Last Post: shubham
  unable to get the webbuttons count(child objects) qtpexpert 2 5,690 07-05-2012, 01:54 PM
Last Post: qtpexpert
  Need a Help with identify child form VB6 programm shan1234 6 4,669 08-12-2011, 11:08 AM
Last Post: gbrahma.sagar

Forum Jump:


Users browsing this thread: 1 Guest(s)