Ask a Question

Labels not found if URL changes

SOLVED
KevinStanley
Occasional Contributor

Labels not found if URL changes

The web testing that I'm performing has labels on down the left side of the page, which are always available and expand when clicked to show additional sections. When I click one of the sections, the URL changes, but the UI remains the same. If I map a label, it maps it to a specific page, which changes depending on the section I choose. Therefore, if I try to have test complete click one of the labels after the URL changes, the object cannot be found because the parent (the page it was mapped from) is not present. Is there a way to map the labels so that they can be found when the URL makes it look like I'm on a different page?

14 REPLIES 14
Marsha_R
Champion Level 3

Using wildcards for the URLs will help a lot. Here's some good documentation about that. Let us know if you have any more questions.

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

KevinStanley
Occasional Contributor

The issue that I'm running into is it can't find the parent objects if the page is different than when it was mapped. The identifiers appear to be good for the object itself, but since the URL is different, it can't find the parent information it is mapped with. 

Marsha_R
Champion Level 3

Yes, I understand that. Did you try using wildcards and it didn't work?

 

On the page I posted above

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

the top section mentions using wildcards in dynamic web pages:

The URLs of dynamic web pages (see Ignoring Query String Parameters

And it mentions wildcards in name mapping

Using Wildcards in Name Mapping

 

Those sections have information that will be useful for you. Try these out and let us know what happened.

 

KevinStanley
Occasional Contributor

Marsha,

  For this to work, I would edit the URL property for the page to include a *, correct?

KevinStanley_0-1652277874623.png

I should then map all of the labels from that page for them to be available at all times from other pages.

I think it would cause issues if I were to add a wildcard to all of my pages, since our system seem to use trees that are not very distinct. Right?

I would try mapping the labels with a wildcard rather than the whole page. Put the wildcard in the part that changes each time.

KevinStanley
Occasional Contributor

This is the part that it cannot find. How would I add a wildcard to that part of the parent?

KevinStanley_0-1652282936827.png

 

What about using Conditional Mapping, https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/cond... ?

 

For example, ObjectType equals 'Panel(0)' or  'Panel(1)' or  'Panel(2)' 

 

rraghvani_0-1652284389503.png

 

KevinStanley
Occasional Contributor

Rraghvani,

  I'll look into that and give it a try if the webpage wildcard does not resolve my issue. Thanks!

Let's see the URL from the label after it's changed

cancel
Showing results for 
Search instead for 
Did you mean: