Forum Discussion

socaltester's avatar
socaltester
Contributor
7 years ago

Can wildcards be used in an object path?

On my project they've got us using test complete to automate functional tests for web applications that are not even close to being "stable", so the paths (or some portion of the paths) tend to chang...
  • tristaanogre's avatar
    tristaanogre
    7 years ago

    socaltester wrote:

     

    - I didn't create a new alias. I simply updated the alias with the new path. Shift+Ctrl+A

    - Perhaps I chose too simple of an example, because most of the time there are entirely new DIVs/Panels/etc that show up in a new release.

     

     


    What I was trying to communicate was that didn't need to update the Alias.  All you needed to do was edit the mapping properties that were already there and you could have preserved your existing Alias.  This could include adding new Panels into the mapping hierarchy.  The Alias can stay static while you manipulate the mapping.  That's what NameMapping does for you.  So long as you just edit the mapping, the Alias can be used, basically, forever.  The link that I posted takes you through all sorts of means of editing, etc., where you can update and modify the mapping including, but not limited to, activating "Extended Find" on a component to account for added DIV/Panels, using wildcards in mapping properties to handle variable data, etc.  

     

    Regularly, we have the same deal where a new panel is added, "breaking" the mapping.  What I do then is I go to the object browser, map the "new" panel, and then, in the "Mapped Objects" panel of name mapping, I drag my originally mapped object to be a child of the new parent.  My Alias doesn't change, but now my mapping is fixed and my tests can continue.

     


    socaltester wrote:

     

     

    - Yes, I'm aware of using wildcards in property values of objects, but what seems to break the tests are the many changes that occur between Sys.browser and the VisibleOnScreen UI object to be tested. Your last sentence, "All you would need to to...", is definitely worth looking into. My predecessor has always chosen to not use TC's "Update Name Mapping during test run" option provided by Engine Options. This seems like a reasonable decision when one should be cautious. What is your recommendation? 

     

    Thank you for taking the time to help this novice. As mentioned in my post, I do search SmartBear's site and the blog for information before posting a question to the community blog, but I may not communicate my post as clearly as I should. My apologies.


    I believe I've answered with my recommendation.  There's no need to update the Alias with a new path (which, essentially, is creating a new Alias).  The Alias can remain as it always has.  Just do a bit of work with the mapping.  I personally would not use "Update Name Mapping during test run".  While automatic mapping is good to get started, it really only works well for very static applications.  Something more dynamic and variable I prefer to do the work myself.

     

    As for helping the novice... my pleasure.  I used to be one, too.  And there were amazing guys here AlexKaras being one of them, who helped me out.  So... I'm paying it forward.  If you need more guidance, let me know.

     

    As to your OP in your subject... the answer to that is "no".  You can't reference an Alias like below (note the wildcard).  This is not how NameMapping/Aliases work.  The answer to your specific problem is to update the Mapped Objects part of NameMapping so that you don't need to change your Alias.

     

    Aliases.browser.pageABC.frameMapIndexHtmlLangEnUsWidgetFrames.form.panelABCProps*.panelDefaultSpeedsRanges.textboxMaxSpeed