cancel
Showing results for 
Search instead for 
Did you mean: 

Aliases vs Full Name (Full Name not working but Aliases is working in some cases)

sameerjade
Frequent Contributor

Aliases vs Full Name (Full Name not working but Aliases is working in some cases)

Hello,

 

I used the object spy on a window in our desktop application. From the object spy information, if I use the FullName, it always fails because it fails to find a certain component in the FullName path. If however, I use the Aliases name, it passes. 

 

Error: Unable to find the object QtObject("ContainerLeft"). See Additional Information for details.

 

Aliases: 

Aliases.ABC.MainFrame.TopWidget.HorzExpandingStrip.splitter.widgetExpander.ContainerLeft.ImportNavPanel.mpTabWidget.qt_tabwidget_stackedwidget.mpSetupsTab.Hds_GuiUtils_TreeWidget.TreeView.qt_scrollarea_viewport

 

FullName:

Sys.Process("ABC").QtObject("MainFrame").QtObject("TopWidget").QtObject("HorzExpandingStrip").QtObject("splitter").QtObject("widgetExpander").QtObject("ContainerLeft").QtObject("ImportNavPanel").QtObject("mpTabWidget").QtObject("qt_tabwidget_stackedwidget").QtObject("mpSetupsTab").QtObject("Hds::GuiUtils::TreeWidget", "", 1).QtObject("QTreeView", "", 1).QtObject("qt_scrollarea_viewport")

 

Has anyone else seen this issue?

 

Thank you.

 

Regards,

Sameer

4 REPLIES 4
JuliaBernikova
Moderator

Re: Aliases vs Full Name (Full Name not working but Aliases is working in some cases)

Hi Sameer,

 

You wrote:

 

>>>

... it fails to find a certain component in the FullName path. If however, I use the Aliases name, it passes.

<<<

 

The behaviour you describe is quite expected - the Name Mapping repository (including the Aliases tree) is supposed to help you avoid problems with using object full names. Thus, it looks like the QtObject("ContainerLeft") object is kind of dynamic: it may either disappear from the tree or appear in a different place which makes the FullName property you copied before invalid. I suggest that you keep using Aliases to refer the application objects. If you encounter any issues, let us know!

Julia Bernikova
SmartBear Customer Care Manager - TestComplete
sameerjade
Frequent Contributor

Re: Aliases vs Full Name (Full Name not working but Aliases is working in some cases)

Thank you Julia!

A follow-up question - is it always recommended to use the Aliases name and not use the Full Name?

 

Regards,

Sameer

tristaanogre
Community Hero

Re: Aliases vs Full Name (Full Name not working but Aliases is working in some cases)

If you have Aliases and mapped objects, it's always better to use that... Aliases and NameMapping have a lot of behind the scenes helpers that make finding dynamic objects, objects that may not appear immediately, etc., work better.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
sameerjade
Frequent Contributor

Re: Aliases vs Full Name (Full Name not working but Aliases is working in some cases)

Thank you Robert!

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