Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetTOProperties count
#1
Not Solved
Hi Guys,

I am working on windows forms. .Net 4 framework and QTP 10, I have installed the frameowrk before QTP10.

QTP is identifying the toolbar as a generic object (SwfObject:Toolbar) and not really a toolbar (SwfToolbar)

Object spy did not get the properties I was looking for, so I used ".Net Windows forms spy". I was able to see the properties of toolbar.

I got all the properties of toolbar using below code, but, count() fails with error Object required: 'val5.Count()'
(toolbar.properties.count(), as shown in below example)

1.
Code:
Set val5 = SwfWindow("Form").SwfObject("toolBar").GetTOProperties
Set a = val5.Count()
Reporter.ReportEvent micdone,"Test1",a
2.
Code:
Set val5 = SwfWindow("Form").SwfObject("toolBar").ChildObjects
Set b = val5.Count()
Reporter.ReportEvent micdone,"Test2",b
3.
Code:
Set val5 = SwfWindow("Form").SwfObject("toolBar").Object.Items
Set c = val5.Count()
Reporter.ReportEvent micdone,"Test3",c

ERROR:
Code:
Object required: 'val5.Count()'
Line (67): "Set a = val5.Count()".

4.
Below example worked
Code:
val = SwfWindow("Form").SwfObject("toolBar").GetROProperty("Enabled")
Reporter.ReportEvent micdone,"Test",val

5.
Code:
SwfWindow("Form").SwfObject("toolBar").GetROProperty("items(16)")
Above executes without error, but when execute below
Set val6 = SwfWindow("Form").SwfObject("toolBar").GetROProperty("items(16)")

ERROR: object required is thrown.


Can you please help me QTP to click an item "Insert Sample" in items(16) as shown in attachment

Also if possible, why is error thrown in example 5, when i add "Set"?

Thanks,
Steve
Update:

Code:
Set val5 = SwfWindow("Form").SwfObject("toolBar").GetTOProperties
a = val5.count
Reporter.ReportEvent micdone,"Test",a

Value for a is coming up as 1, which is incorrect, it has got more than one property.


Attached Files Image(s)
   
Reply


Messages In This Thread
GetTOProperties count - by Steve.Govinakovi - 06-05-2012, 06:13 PM
RE: GetTOProperties count - by Steve.Govinakovi - 06-05-2012, 07:14 PM
RE: GetTOProperties count - by supputuri - 06-05-2012, 09:33 PM
RE: GetTOProperties count - by Steve.Govinakovi - 06-06-2012, 05:19 AM
RE: GetTOProperties count - by supputuri - 06-06-2012, 10:14 AM
RE: GetTOProperties count - by Steve.Govinakovi - 06-06-2012, 06:03 PM
RE: GetTOProperties count - by Steve.Govinakovi - 06-07-2012, 04:56 PM
RE: GetTOProperties count - by supputuri - 06-07-2012, 06:38 PM
RE: GetTOProperties count - by Steve.Govinakovi - 06-08-2012, 08:04 PM
RE: GetTOProperties count - by Steve.Govinakovi - 06-10-2012, 10:12 PM
RE: GetTOProperties count - by Anamika sinha - 04-15-2014, 05:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Diff. between page checkpoint link count and childobj count anemuday 0 2,245 07-20-2008, 10:11 PM
Last Post: anemuday
  Using GetTOProperties & Count function Akhila 1 3,704 07-07-2008, 11:44 AM
Last Post: surya_7mar

Forum Jump:


Users browsing this thread: 4 Guest(s)