Ask a Question

Testcomplete does not use "automation id" of a WPF "window" as identifier.

SOLVED
handanu
Contributor

Testcomplete does not use "automation id" of a WPF "window" as identifier.

Hi,

I'm using keyword test for WPF application. Every object in the application we set unique automation id. In name mapping tab (mapped objects and aliases "properties" screen or edit name mapping window-->"selected" area) controls like buttons, textbox "Automation id"s take place as identifier. But when it comes to popup windows although windows has automation id, it is not used for identification.(name or something else been used).

I don't want to add "automation id" to "selected" side in "Edit Name Mapping Item" window one by one. Because I have/will have many popups.

Test complete version: 14.10

Thank you very much.

6 REPLIES 6
tristaanogre
Esteemed Contributor

TestComplete's auto-mapping does not always use what we, the users, would strictly want it ot use.  This is why I RARELY use it.  I map things manually, first, and then write or record the tests.

 

There isn't, really, a "mass" way of going back and editing all existing mappings.  And I'm not entirely sure if there is a way to control what properties to use. I believe that templates MAY help with this, but I've not had much experience with them.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Thank you for your answer. But there are hundreds of controls and hierarchy changes sometimes. Our solution is that give controls unique automation id. Textbox, buttons vs there is no problem but popup windows are problem. 

Also, how you map things manully first. Every control? or parent control?

I directly record the test. Generally tests run successfully but sometimes hierarcy changes and i remap it manually.

Nowadays, my problem is that controls over popup windows may not be recognized. We (with dev team) think that problem may be caused from this reason.

tristaanogre
Esteemed Contributor

You can either use the map object from screen item

mapobjecticon.png

 

Or, from the object browser, right click on any object and select "Map Object"

 

MapFromObjectBrowser.png

 

As for hierarchy changing, that's what "Extended Find" option in NameMapping is for.  You can preserve mapping without needing to remap by judicially using that feature.

 

And I map almost every control that I intend to use with some exceptions.  I don't map EVERY control in the application because I'm not always using everything.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Thank you. But it is not what i'm looking for. There must be an easier way to use automation id's as identifiers. If I find, I will share.

I asked to support team. Templates could be answer for the problem (https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/temp...) But it is useful only if before recording (mapping) the objects . Otherwise it is not applied.

Several way avaliable:

1-Delete existing mapping and remap

2-Modify the name mapping file outside of TestComplete (not recommended)

3-Edit the object (right click the object and click "edit" then move automation id property to "selected" side)

 

cancel
Showing results for 
Search instead for 
Did you mean: