Forum Discussion

LHallemann's avatar
LHallemann
Occasional Visitor
2 years ago

Inconsistent object names under Windows 11 and Windows 10

Hello, 

our existing tests, which were defined under Windows 10, are not running under Windows 11 anymore. For us it is essential to run the defined tests on both platforms: Windows 10 and also Windows 11.
Obviously, the object naming (between Windows 10 and Windows 11) has changed and is now inconsistent. e.g., object naming of windows explorer toolbar:
Win 10: Aliases.explorer.wndCabinetWClass > toolbar
Win 11: Aliases.explorer.wndCabinetWClass > toolbarAddressE
How can we run our existing tests on Windows 10 and also Windows 11?

1 Reply

  • KB1's avatar
    KB1
    Champion Level 2

    One approach you can try is to use the "Aliases" feature in TestComplete to handle the object naming differences between Windows 10 and Windows 11.

    Aliases allow you to create a custom name for an object that you can use in your test scripts.

    This way, you can create an alias for the "toolbar" object in Windows 10 and another alias for the "toolbarAddressE" object in Windows 11, and use the appropriate alias depending on the platform you are running the test on.

     

     

    To create an alias, you can follow these steps:

    1.       In the Object Browser, right-click the object that you want to create an alias for and select                           "Create Alias" from the context menu

    2.      In the "Create Alias" dialog, enter a name for the alias and click "OK".

    3.      In your test scripts, you can use the alias name to access the object. For example, you can use "Aliases.toolbar" to access the "toolbar" object in Windows 10 and "Aliases.toolbarAddressE" to access the "toolbarAddressE" object in Windows 11.

    4.      To switch between the aliases depending on the platform you are running the test on, you can use conditional statements in your test scripts. For example, you can use an "if" statement to check the operating system version and use the appropriate alias based on the result.

     

    I hope this helps! Let me know if you have any questions or need further assistance.

     

     

    Edit: Formatting