cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot call .NET method for object returned by FindChild

Highlighted
Contributor

Cannot call .NET method for object returned by FindChild

I have an interesting scenario where I'm unable to call a .NET method for an object returned by FindChild, but can call the same .NET method if I reference the object fully.



Here's the code that works:



var obj =
NameMapping.Sys.pCatalyst.hwndWave.wWave.wavectrlMain.dpnlWave.WPFObject("Grid",
"", 1).WPFObject("mFrame").WPFObject("DefaultQuickWavePage", "",
1).WPFObject("StackPanel", "",
1).WPFObject("mQuickWaveControl").WPFObject("StackPanel", "",
1).WPFObject("StackPanel", "", 2).WPFObject("StackPanel", "",
1).WPFObject("mLimitPriceControl").WPFObject("StackPanel", "",
1).WPFObject("mComboBoxLimitType");



obj.SelectItemWithValue(obj.Items.Item(0));



Here's the code that does not work:



var obj = NameMapping.Sys.pCatalyst.hwndWave.FindChild("NativeClrObject.Name", "mComboBoxLimitType", 14);



obj.SelectItemWithValue(obj.Items.Item(0));



The .NET method in question is SelectItemWithValue, but I'm sure it affects all .NET methods.
1 REPLY 1
Highlighted
Contributor

Nevermind, I figured it out.  The object returned from FindChild is indeed a different object (comparing the FullName properties).  I didn't realize developers would name two objects the same...
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors