Forum Discussion

BernardFanthom's avatar
BernardFanthom
Contributor
10 years ago

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?

 

 

  • BernardFanthom's avatar
    BernardFanthom
    10 years ago

    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:

     

     

  • Sounds like TestComplete is set to automatically update the mappings during test runs. The option can be enabled/disabled from Tools > Options > Engines > Name Mapping - Update Name Mapping during test run.

     

    TC_Name_Map.jpg

    • BernardFanthom's avatar
      BernardFanthom
      Contributor

      Thanks Mes0673

       

      I have checked this out and the name mapping setting IS unticked. However it is also sitting in a folder called mobile. does this affect things? Should there be an additional name mapping settings under Engine?

       

       

       

      Screen shot at 20150521.png

      • mes6073's avatar
        mes6073
        Contributor

        Not sure about the mobile folder as we do not install the Mobile/Apps testing components. From the screen shot, unless the folder is not expanded it would appear that the mapping settings would apply to tests for mobiles apps/devices but we will need SmartBear to offer advice on whether that is the case.