Forum Discussion

sedens's avatar
sedens
Contributor
3 years ago

URL does not refresh for page that has a different public link

Hello, I have a web application that passes encrypted information in the URL so when I pass info to this page the URL is different each time because of the encrypted information in the URL, for example: https:www.example.com/publicLink/Abc938485458dDKKjfjf etc. This gets mapped in the Name Mapping repository as "pageAbc9384" with that specific URL. 

 

I have a property checkpoint on that page to check it contains the information I'm expecting. However, when I run the test, it keeps saying the object "pageAbc9384" does not exist.

 

I have added RefreshMappingInfo to that page in my test but that does not seem to refresh the URL as the property checkpoint line still throws an error. Is there any other property/object/function I can use to refresh the URL each time the page is loaded so that it picks up the new public link on page load?

 

Any suggestions appreciated!

 

Thanks. 

  • Hi sedens!

     

    I think the easiest solution here would be to handle the dynamic data of your parent URL, this way the objects that are being validated can be found even when the URL changes. 

     

    We can apply a wildcard to any dynamic data in TestComplete by using an asterisk (*). 

    For instance, you could remove the encrypted portion of the URL in the Parent mapping and replace it with a wildcard, i.e. = www.example.com/publicLink/*

     

    In my example below I altered the parent URL of an object I am validating to handle a dynamic section. This way my checkpoint will still work on any object under this URL as along as the areas before and after the wildcard still match.

     

    Here is the doc on using Wildcards;

    https://support.smartbear.com/testcomplete/docs/reference/misc/using-wildcards.html

     

    I hope this helps!

     

  • Hi sedens!

     

    I think the easiest solution here would be to handle the dynamic data of your parent URL, this way the objects that are being validated can be found even when the URL changes. 

     

    We can apply a wildcard to any dynamic data in TestComplete by using an asterisk (*). 

    For instance, you could remove the encrypted portion of the URL in the Parent mapping and replace it with a wildcard, i.e. = www.example.com/publicLink/*

     

    In my example below I altered the parent URL of an object I am validating to handle a dynamic section. This way my checkpoint will still work on any object under this URL as along as the areas before and after the wildcard still match.

     

    Here is the doc on using Wildcards;

    https://support.smartbear.com/testcomplete/docs/reference/misc/using-wildcards.html

     

    I hope this helps!

     

    • sedens's avatar
      sedens
      Contributor

      Thank you! That wildcard suggestion worked. Your help is much appreciated.