Forum Discussion

j_smith's avatar
j_smith
Occasional Contributor
12 years ago

two WinFormsObject items have the same MappedName

Hello,



I have run into a situation where I have two WinFormsObjects that have the same MappedName, and only one of those WinFormsObjects has the correct MappedName.  They are identified as WinFormsObject("Main") and WinFormsObject("ChartChoicesForm").  They both have a MappedName of Aliases.LifeQuest.Main.



The WinFormsObject("ChartChoicesForm") is a form that is created on a certain button click in the Main form and shown using the C# method .Show().



When I begin to interact with the WinFormsObject("ChartChoicesForm"), the controls I'm interacting with aren't found by TestComplete.  According to TestComplete at this point in time, the controls I'm interacting with should be found within WinFormsObject("Main").  This is causing the error "Unable to find the object WinFormsObject("chartsToChooseFromGroup").  The chartsToChooseFromGroup is referring to a Group control on the ChartChoicesFrom object.  I can't seem to find a way to update the MappedName of the ChartChoicesForm to be different than the Main object's MappedName.



Does anyone have any ideas on how I can rectify the situation?

1 Reply

  • Hi Jake.



    In case when TC mapped screen objects incorrectly you should map object manually or redefine object identification approach if object already mapped (in mapped objects tree view select your object and click Edit button above). After that you have to define the set of properties which helps TC identify your object uniquely. On the right pane of editor you may see properties of your object, clicking left or right arrows in the middle you may add or remove specific properties for object identification (for example, ChildCount may be helpful).



    Additional approach of object identification uses specific set of child objects (buttons, captions, controls etc) your object must have for unique identification. When you select mapped object in tree view, in the right pane you may see Required Children tab. You may place ticks into the boxes next to desired children of your object. If the pane with children is empty or does not contain children you need, right click on the object in tree view and select Map Child Objects in context menu (your object should be active/on screen at this moment).



    First redefine object already mapped by TC ("Main"). After that you may manually map your second object ("ChartChoicesForm") using Map Object From Screen icon and similar approach in selecting properties and child objects.



    Don’t forget to assign different meaningful names for your objects in mapping structure.