Forum Discussion

jmassey's avatar
jmassey
Contributor
7 years ago

Search through Object Mapping in Current Project Properties

Is there a way to search Object Mapping? I have a fairly simple custom control (to the extent that I or TestComplete care, it's just a textbox and an icon - the rest is just input validation stuff) that works fine in WinForms, but the latest UI in our software is being done in WPF, and there is a WPF wrapper around that same custom control. This is making TestComplete unable to dig down into the control. I think I may have mapped the old custom control to something else, but I can't seem to find it.

 

Is there a way to see what custom mappings I've done? Or search for a classname in Object Mapping? Or alternatively, if I haven't mapped it to anything and TestComplete is just figuring it out for itself, is there a way that I can tell in ObjectBrowser what type of control a custom control is being interpreted as, so that I can then go explicitly plug in that mapping for the WPF version?

2 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

    Don't know I really understood your problem  ...

     

    Yes, you can search on name mapping tab. Open Name mapping tab and click Edit at top menu then find...

    But you have to remember what you have mapped at least part of mapped name.

     

    In Object browser it shows the current snap shot of objects

    Since this object mappings are currently mismatching, you wan't be able to find in object browser.

     

    best thing would be

    1) go to your script and get what old name

    2) search it in name mapping

    3)  change name mapping as to match new object property

    • jmassey's avatar
      jmassey
      Contributor

      I am talking about Object Mapping, not Name Mapping. Tools -> Current Project Properties -> Object Mapping; the place where you tell TestComplete to treat such-and-such custom control as if it were an Infragistics UltraGrid or what have you. Is there a way to search in there to see which custom mappings I have done?

       

      And then, on the alternative, in Name Mapping / Object Browser - I have two different controls in different parts of the app. One of them is a WinForms custom control. TestComplete is able to automate this custom control correctly. It is basically just a combination of one or two icons/buttons and a text box with some special functionality. TestComplete is able to identify the different components and automate them correctly, with .e.g 'SetText' on the textbox and so on. The new control - the one that is giving me problems - is this same exact control, but since we're now transitioning to WPF, it's tucked up inside a WinFormsHost. TestComplete is unable to dig down any deeper than the WPFObject("FormsHost"). It cannot distinguish between the button and the text box. I was hoping that I could find out what it is that TestComplete is recognizing the control as in the old version, and then apply that mapping to the new one - but I cannot just overwrite the old with the new. Both are in use in the software at current, and are in completely different locations.

       

      A different (but possibly related?) problem I am having with these controls - and only these controls, in the entire form, which has many - is that TestComplete has 'VisibleOnScreen' set False, even though they are clearly visible and not obscured by anything else. There are 3 controls on this particular Grid container, two of these that are giving me trouble, plus one ComboBox. The CB works fine, but TC refuses to operate on the FormsHost-contained custom controls; I've had to resort to calculating their positions relative to the dialog window and then using coordinate clicks and keypresses targeted directly to the window. This is getting me by, but it's obviously not ideal. I would like to find a way to get this working properly.