Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20990

TestComplete adds number to WPF object

$
0
0

We have a WPF desktop app where some of the object names are having numbers added to them.  For instance, when you record a test and create a CheckProperty test, it saves the objects name as:

 

hwndSource.MainWindow.Grid.AdornDecorator.PaneLayoutControl.PanePresenter.TestGridPaneView[x]

where [x] is a single digit numeric.

 

It has only happened with the Views that contain grids. In writing test scripts, I started noticing these different numbers being added. When trying to playback these scripts, they quite often fail because the grid object has a different number than what the script is calling for and the key tests also fail for this same reason. The thing is these objects should not have any number assigned to them. I'm assuming this is from "something" trying to disambiguate the names, but I'm not quite sure why it would do this, but not provide a mechanism to retrieve the name. If you look at the PanePresenter's Context or DataContext, this name doesn't appear anywhere.

 

It appears to be something added when the app is run and there is no mechanism in our code to come up with such names. Not sure if this is being done by the .Net runtime or by TestComplete.

 

Has anyone else ever heard of this issue and, more importantly, is there a way to get the name at runtime?

 

Thanks.

 

-Ron

 


Viewing all articles
Browse latest Browse all 20990

Trending Articles