cancel
Showing results for 
Search instead for 
Did you mean: 

Web object names keep changing from Aliases.chrome to Aliases.browser

Frequent Contributor

Web object names keep changing from Aliases.chrome to Aliases.browser

Hi

 

I need some advice on web object identification..

 

Many of the tests I have do not currently function properly and have to be helped along quite a bit. This is something I want to change asap - it's painful to have to do this and is a major consumption of my time.

 

The most common issue I come across is with the object not being found on the web page. If I try to highlight the object on the screen it can not be found, so when I use the drag and point to the object again I find that the Alias name has changed from Aliases.browser to Aliases.chrome.

 

After some reading a while back I understand that the object name associated with the test operation changes as per the browser it is running in and after the first initial run. Perhaps my understanding of this is not clear because I'm finding this to be the case even with every test run against the same browser each time. At the most I would expect to point to the object once in one browser and have the object name (Ok, Alias name) be set Aliases.chrome. for example, but in this case it seems to change per test run regardless of the browser I'm using.

 

 

I am in the process of rewriting these tests to use Run Browser to enable us to use the Browser loop operation and test against more than one browser, as well as using a more standard approach to web browser testing - i.e. not using TestedApps.

 

I recently read that Extended Find should be used for all web objects due to the dynamic names of some objects so I've changed this this morning and so will see if that helps.

 

As always, any help or advice is much appreciated!

 

Thanks

Jenny

9 REPLIES 9
Community Hero

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

It's likely changing for two reasons, you have automatically map objects turned on, and you are not wild-carding your mapping of the browser. 

 

Can you provide a screenshot of your namemapping and properties being used to identify the browser? 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Frequent Contributor

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

I think you're probably on to something there. I know we have "Map object names automatically" enabled in the project but I don't think we're wild-carding the mapping of  the browser.

 

 

I can see that in the properties for the Browser object it shows "chrome" in various places.... This looks a a bit odd..

 

How would you recommend to implement wildcards in this instance?

 

Community Hero

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

Frequent Contributor

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

Thanks Marsha!

 

Just to check is this how to resolve the issue I'm having?

 

I'm finding that the parent name changes between test runs.... from, .browser to .chrome for example...

 

The link you've provided details wild-carding the actual object name?

Community Hero

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

As @cunderw said above, you want to wildcard the browser object.  This way it will map to any browser that matches the pattern you give it.  

Frequent Contributor

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

Hi Marsha,

 

Thanks for your reply.

 

I've thought about this and watched the video a few times. I'm sorry, but I'm not quite sure how doing this helps my issue.

 

I'm not having issues with dynamic object property values. The object identification is failing at it's earliest point in the search.... at "browser" or "chrome" etc (whatever the browser may be). How does adding a wildcard to a dynamic property value mean that it will find "browser" (several objects above the sought for object in the object path)?

 

Also, what happens in the case where the objects do not have dynamic property values? I suppose adding a wildcard might not hurt but it must have some effect?

 

I do think I understand the advice being given - thank you for this - but I am struggling to see how it helps find the browser object.

 

 

 

Thanks,

Jenny

Community Hero

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

That's the whole point of the wildcards.  Your test calls for Aliases.chrome but your mapping says Aliases.browser or something similar.  If you change the mapping to Aliases.* then it will match whatever browser you are using (as long as the children are all the same).

Frequent Contributor

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

Hi Marsha

 

Thanks, I get that. 🙂

 

What I don't get is how adding a wildcard to a object property value means that testcomplete knows to look for Aliases.* and not Aliases.browser etc....

 

Thanks,

Jenny

Community Hero

Re: Web object names keep changing from Aliases.chrome to Aliases.browser

Okay, show us the code that fails when the browser changes.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors