I am automating an WPF application whose control names may change during software development. So I am planning to use Automation IDs to identify objects uniquely. Is there any way to do this using TestComplete?
The TestComplete version I am using is 12.30.
Thanks for your reply first, I got it.
Another question I want to ask is how to add AutomationID as the default property? From TestComplete's website, it says that for the object "ObjectIdentifier"
"The value of one of the following native properties of the object (ordered by priority):
I want to use AutomationID as the default value of the "ObjectIdentifier", so that I don't need to add the "AutomationID" manually for each object each time, that would be saving time greatly.
I don't believe that there is a way to change that hierarchy or priority. If your UI Automation object has a "Name" property, that is what is going to be used.
Check if NameMapping Template can help in your case: http://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/templ...
Yes I tried the "template" method but for me it doesn't work as described.
My goal is: add "AutomationID" as default identification property for every object/controls.
The first issue is: it requires to fill in the "Category" field myself. I tried to enter in ".NET Objects" and "WPF Controls" as two templates but I am not sure whether the wording is correct. is there any way easier? or is there any category which covers all the controls?
The Second issue is: after I set the template as below: add two templates for two specific objects, and then record a new keyword test, then only the two objects has the AutomationID as their nameMapping property, the other objects still follows the nameMapping property as they were. it's even slower than I manually add automationID to the specific two objects, and my goal is to add AutomationID to all objects.
"To modify the value of a base property, enter the new values in the property’s Criteria cell. You can use regular expressions to specify variable parts of the property value. For example, to associate a template with an object that has a specific property regardless of the property value, specify .* in the property’s Criteria cell (this regular expression matches any string)."
So I change the value to be "*" for the two specific objects which were used to setup two templates, then record the keyword test, this time NO object has the "automationID" in their nameMapping, neither does the two specific object.
I am so confused, do you have any suggestions on that? I really don't want to add "AutomationID" manually for each object...