Forum Discussion

kmaclean's avatar
kmaclean
Occasional Contributor
13 years ago

Keeping NameMapping valid with variable Page URL

I am new to Smart Bear testing, and we are trying to devise a test suite that is portable enough to be run on different environments using TestExecute. This will enable a combination of build integration,  developer testing and QA use.  Developers have their own servers and might run using "localhost" with uncommitted code, the build server will deploy the most recent build and QA needs will depend on the version that they are testing.



The Project Suite's initial design is with two projects - a "Common" project that will contain Scripts, tests and NameMappings that will be used by all Projects.  Then, there will be other projects focused on testing different areas of the application.



My initial test is with the Log In page - pretty simple, but it is serving to expose difficulties with the planned architecture.  The problem I'm encountering is that the NameMappings are not working when I attempt to use a variable URL.  I have created a ProjectSuite Variable for the EnvironmentalURL, and have modified the NameMapping for the page element 'pageTopazEnterprise.URL' property to refer to the variable instead of a constant.  Note that in the sample code, the URL property in the NameMapping has been reset to a constant, and all is working properly.  When running the test suite, I get the following error:



An error occurred while calling the "Wait" method or property of the "pageTopazEnterprise"
object.

The object or one of its parent objects does not exist.


Tested Object













Alias: Aliases.iexplore32.pageTopazEnterprise
Mapping item: NameMapping.Sys.iexplore.pageTopazEnterprise

Missing Object













Alias: Aliases.iexplore32.pageTopazEnterprise
Mapping item: NameMapping.Sys.iexplore.pageTopazEnterprise

Possible causes of the
error


So the question is obvious - how can we use a variable URL and still keep the NameMappings intact?  Our application is far too complex to move forward by manually mapping controls (a lot of drag and drop Silverlight functionality for one, and unnamed controls as well), so the NameMapping is critical.  Is there a solution to this problem?



I am blocked on further test development until I can get an answer, though I will focus on configuring my servers and a test environment in the meantime.  Applicable portions of my test project are attached.



Kerry MacLean

2 Replies

  • Hi,




    how can we use a variable URL and still keep the NameMappings intact?


    To make mapping settings independent of dynamic URLs, you can use wildcards. For more information, please read the Using Wildcards online article.

  • kmaclean's avatar
    kmaclean
    Occasional Contributor
    Thanks, Margaret.



    I had tried wildcards, but it took some fiddling around to get them to work properly.  I'm now able to run the suite using TestExecute.  All is not perfect, but progress is being made.