Mapping TestComplete scripts against VB6 application. Losing mappings very rapidly.
All,
Since getting a new release of a system written in VB6 I am having to do a heavy overhaul on the scripts regarding remapping objects.
This body of work is heavily compounded by mappings changing dynamically inside TestComplete work sessions, and with no changes to the excutable itself.
For instance the mapping on a combobox is changing from:
Aliases.QLX.frmQLXMain.MDIClient.Item35.Item.FRMMHRA001.tabTenancy.sspTenancyEnquiry1.Frame1.ctlQLHxCombo1_11.cboMaintField.BalFreqComboBox
to:
Aliases.QLX.frmQLXMain.MDIClient.Item37.Item2.FRMMHRA001.tabTenancy.sspTenancyEnquiry1.Frame1.ctlQLHxCombo1_11.cboMaintField.cboXField.Edit
I have tried to wildcard the fullname and provide a mapping setting (as per BalFreqComboBox in the top entry). However this soon lost, around the area of the Item clause (highlighted above).
Any ideas?
On a different forum I got the following reply which I will adopt moving forward. I also believe that moving forward future builds of the app written in VB.NET will not have mapping problems as bad.
In TestComplete, you can create aliases. That is the preferred way.
What I like to do is create an alias at 3 levels, 1st at the screen level (what ever window or dialog), then 2nd at the container level (what ever section or parent table is holding the target control), then finally one at the target control.
From there, you can remap those aliases to adjust to most major changes under the AUT.
So after you do your mapping, first map the window, assign it an alias, then map the container relative to the alias assign that an alias, then map the control relative to the container alias and assign that control an alias. Then when you reference controls in your tests, use the control's aliases instead of the direct mapping.
That cooler thing you can do from there, is you can create different mapping profiles in TC, that reassign those aliases. Which will allow you to keep your tests backwards compatible.
I put this question out on a different forum and got the following advice which I am going to stick with moving forward. I also believe that future builds of the app in VB.NET should "quiten" the mapping problems: