Novari-QA's avatar
Novari-QA
Frequent Contributor
7 years ago
Status:
New Idea

Ability to create empty aliases

As a name mapping extraordinaire. I would like the ability to create Aliases out of thin air.

In my situation, I have 2 pages, each look identical. 

Page 1
 - Object A
 - Object B
Page 2
 - Object C

What I would like to do, is to simply right click on the Aliases panel and select "Add Empty Alias". I can then drag and drop my objects in this this Alias.

Empty Alias

 - Object A

 - Object B

 - Object C

 

This way, I script object C as such.  Aliases.browser.EmptyAlias.ObjectC

6 Comments

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Honestly, I don't think this is going to happen because this, generally, "breaks" the Aliases feature.  In your example, "EmptyAlias" is designated as a child of browser... the NameMapping engine, starting with browser, is going to try and find something that identifies as EmptyAlias.  To make this change, the NameMapping engine will need to be altered in a way to totally break the identification algorithms for objects.  

     

     

  • Novari-QA's avatar
    Novari-QA
    Frequent Contributor

    This may be due to trying to learn a new process, but jumping right into it, i think it would be cool if I could "catorgize" these objects.

    For example, I have a page, and this page has multiple forms.
    I'd like to categorize the forms to have buttons, links, selects, etc.

    Page

     - Button
      - Submit
      - Cancel

    So in code I can write  
    Aliases.browser.Page.Button.Submit

    Clearly button is not linked to anything on the page, so building a "fake" alias can help organize.  This is imo a poor example, all my issue i am running into a too specific to my circumstance.

  • Novari-QA's avatar
    Novari-QA
    Frequent Contributor

    I suppose i can solve this by prefixing all of my elements with *_.

    For example
    Page_Login
     - Textbox_Username
     - Textbox_Password

    This way, the intelisense will pick up all the textboxs on that page when i type in 'Textbox_'

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    your latest post is the naming convention we adopted here...  every mapped object starts out with a classification descriptor (table, panel, button, checkbox, page, etc).  Now, we do it camelCase (buttonOK, checkboxYes, etc), but that's our own naming convention.

     

    Just as a side note...  I NEVER keep the default naming that TestComplete provides automatically.  Everytime I map something (and I do the mapping by hand rather than allowing the "recording" to do it), when prompted, I select the option to edit the mapping rather than accepting the defaults.

  • Novari-QA's avatar
    Novari-QA
    Frequent Contributor

    Sorry AlexKaras, no the copy paste feature does not create empty Aliases. 

    What I ended up doing was ignoring the Aliases feature entirely and instead creating objects that hold what I need. This way I can simulate my own aliases while referencing existing ones