Forum Discussion

EkremMese1's avatar
EkremMese1
Contributor
2 months ago

NameMapping question with 2 identical HTML code

Hi everyone,

I have 2 URLs for my testing application. They are identical. The page has literally same HTML code. 

I wrote tests for the 1st URL and mapped many Web Elements which also exists in second URL too. 

Now I want to switch to 2nd one and all my tests are failed. 

Is there a way to simply change the URL and everything works fine? 

 

Thanks in advance.

5 Replies

  • Or may be I can use a different operator with - Or - to pass the URL but how can I pass the 2nd URL? 

     

  • I checked the links and documents that you shared. 
    This part looks useful for me: 

    However there is an issue: My URLs are almost completely different than each other. Can I manage to use wildcards still?

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    See previous posts,

    https://community.smartbear.com/discussions/testcomplete-questions/textbox-not-found-during-test/265240

    https://community.smartbear.com/discussions/testcomplete-questions/testing-on-multiple-suites/265224

    If all pages on the website are the same, and the only difference is the URL. Then you need to use wildcard or conditional expression for the parent object.

  • This is my NameMapping tree: 

    The items which are mapped under the parent item can not be found when I switch to URL2 

    Because pageDashboard... item is pointing URL1

    Is there a way to handle that in a dynamic way?