Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collecting Objects And Object State At Runtime
#1
Not Solved
I have tried several online examples for this, but none of them worked.

At my work we have a web based application where the user enters a CODE and is taken to a webpage that has a form with hundreds of objects on it.

Each webpage is unique and actually ALL the possible objects are always on this particular page, some are just not visible and/or enabled.

I need to programatically collect each object name and state (visible, not visibleenabled, disabled) and dump this data to a spreadsheet or a pipe delimited text file (that I will import into Excel).

I have all the possible CODES in the Global Table section of UFT and it will now loop through each CODE and land on the page that I need to collect data from.  It currently takes a screenshot but I do not want to go though all 200+ screenshots and manually list each visible item.

I'd rather do it once and collect the data in Excel.  Then I can get the developers to sign off on the DOM data I collected as our official Requirements because currently they do not have any requirements to give us. (for real!!).

I'll list below one of the online examples I tried and the error I got.  If anyone can help me accomplish this I would appreciate it.  


Code:
ChilObjs = Browser("my actual correct browser name was here").Page("my actual correct page name was here").Childobjects

tol=Chilobj.count

for i = 0 to UBound(tol)

a =chilObjs(i).Name
print a

Next


The error I get is "Wrong number of arguments or invalid property assignment: 'ChilObjs'"

And I was just trying to get the name here, not even trying to get whether the object was visible or enabled yet.

Thank you for your time,


Rolleyes
Reply
#2
Not Solved
At the first glance I can see a syntax error

Chilobj.count 

(You missed the s , Chilobjs.count)
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Not Solved
I fixed that syntax error and it still won't do what I need it to do.  Has anyone accomplished this?

Thank you
Reply
#4
Not Solved
Hey,

you have to use the GetRoProperty method and fetch the object property and values, rather simply saying .Name.

Try the below.
chilObjs(i).GetRoProperty("innertext") or chilObjs(i).GetRoProperty("text")
Thanks,
SUpputuri
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Default state of new action aparajita 1 2,337 08-25-2015, 12:11 AM
Last Post: aparajita
  How to add all objects manually in object repository rajaselvan.d 2 12,670 10-10-2014, 05:08 PM
Last Post: nivedita
Exclamation UFT is not finding object in runtime but able to locate the object from repository amar.vallapreddy 1 2,729 02-25-2014, 02:22 PM
Last Post: guin.anirban
  User defined Objects(Can't map standard grid object in to table object ) madhavanr 0 2,595 01-14-2014, 03:46 PM
Last Post: madhavanr
  Can we access a table element in Script at runtime without a corr. test object? sepgs2004 1 3,046 10-14-2013, 07:05 PM
Last Post: anil2u

Forum Jump:


Users browsing this thread: 1 Guest(s)