Forum Discussion

TylerSadler's avatar
TylerSadler
New Contributor
5 years ago
Solved

NameMapping - Can You Use A Project Variable And Add To It Like A Constant?

I am aware that you can use either a Constant or a Project Variable, but is there a way to use both?

For instance if I have multiple environments such as: www.mysite.com, www.dev.mysite.com, www.qa.mysite.com and my test goes to www.mysite.com/account/profile/update how can I do something along the lines of
(Property, URL)/account/profile/update so that the NameMapping and tests can be ran on all environments without changing anything but the URL?

I came from Ranorex and this was a normal thing, but I cannot seem to find it in TestComplete. Any help would be greatly appreciated.

  • Hi,

     

    Considering your example, you may use www.*mysite.com* as a constant value for the URL property when mapping page object.

     

  • You can use wild cards in the name mapping.

    *.mysite.com* works for all of the cases you prested.

    Also you can set project variables and use

    URLValue = Project.Variables.MyURL + "/account/profile/update "

     

    where Project.Variables.MyURL = *.mysite.com

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Considering your example, you may use www.*mysite.com* as a constant value for the URL property when mapping page object.

     

  • kevin_kapell's avatar
    kevin_kapell
    Frequent Contributor

    You can use wild cards in the name mapping.

    *.mysite.com* works for all of the cases you prested.

    Also you can set project variables and use

    URLValue = Project.Variables.MyURL + "/account/profile/update "

     

    where Project.Variables.MyURL = *.mysite.com