Forum Discussion

mmccollum's avatar
mmccollum
Occasional Contributor
5 years ago
Solved

Test Complete Looses Aliases

Hello,

I have built alot of tests with Test Complete, however suddenly my aliases have changed inside of the system. For instance:


This:

Aliases.javaw.MainWindow.RootPane.null_layeredPane.null_contentPane.SplitPane.Panel.ToggleButton3.ClickButton(True)

 

Became:

Aliases.java.MainWindow.RootPane.null_layeredPane.null_contentPane.SplitPane.SwingObject("JPanel", "", 0).SwingObject("JToggleButton", "Log Viewer", 3)

 

Im not exactly sure how to proceed all of my tests are now broken and ill need to refactor them to allow for these new paths. Any suggestions?

  • sonya_m's avatar
    sonya_m
    5 years ago

    mmccollum , I see.

    Glad that you managed to make it work using this workaround. I’ll mark this as a solution for now.  

7 Replies

  • Wamboo's avatar
    Wamboo
    Community Hero

    I understand that in your current situation you can't run the test.

    Back up your project and run TestComplete with an option where TestComplete itself dynamically updates NameMApping data in the repository and see what the results will be.

     

    This option is in:

     

    Tools -> options -> Engines -> NameMapping

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thank you everyone for participation in the discussion. 

       

      Hi mmccollum, did you manage to solve the issue? What approach did you use? 

      • mmccollum's avatar
        mmccollum
        Occasional Contributor

        Honestly no I havent yet, I went around the problem by using a namemapping file from another instance of test complete that was working and that seems to fixed it for now, however it may not work forever.

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi,

    Not sure to understand but your first line is a mapped object but your second is not a mapped object, you have for example instance numbers...

    assuming all that has changed is the name of the process ("javaw" became "java"), you should open your namemapping and just rename this single thing in the mapping tree.

    • mmccollum's avatar
      mmccollum
      Occasional Contributor

      What im saying is the path changed quite a bit using the object spy i get this


      Aliases.java.MainWindow.RootPane.null_layeredPane.null_contentPane.SplitPane.SwingObject("JPanel", "", 0).SwingObject("JToggleButton", "Current Status", 1)

      What i got last time is
      Aliases.javaw.MainWindow.RootPane.null_layeredPane.null_contentPane.SplitPane.Panel.ToggleButton3

      • cunderw's avatar
        cunderw
        Community Hero

        Are you relying on the automatic mapping (it looks like it)? If so that will never be reliable. You will have to manually manipulate the attribute used to identify you objects to something that is not dynamic.

         

        What it looks like is the panel JPanel for your ToggleButton was mapped with an identifier that is dynamically generated. You also have a full list of aliases that aren't really doing anything for you since you will never interact with things like RootPane, contentPane, etc...

         

        If you have't I suggest reading trough the documentation here: https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/index.html as well as watching some of the training videos SmartBear provides. Namemapping takes practice and trial and error to get a solid and reliable mapping setup.