cancel
Showing results for 
Search instead for 
Did you mean: 

Any pitfalls with making most of the aliases on the root level?

SOLVED
Highlighted
Occasional Contributor

Any pitfalls with making most of the aliases on the root level?

I'm testing an Android app.  I've been building out the Namemapping and Aliases.  I'm wondering if there's anything I should be aware of if I copy most of the objects onto the root level of the Alias section for easy access.  Otherwise, I typically have to drill down 7 to 11 levels deep just to get to them.

 

Off the top of my head, make sure all names are unique.  Else you get run time errors, or logic errors as TC references the wrong object.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

Re: Any pitfalls with making most of the aliases on the root level?

Are you using keyword tests or scripting? If you're writing scripts you can assign your name mapping to variables, making that the new root.

e.g. mainPage = Aliases.App.HwndSource_Window.Window.MainFrame.MainPage;

 

You can do this for keyword tests by setting a project-wide variable and using that.

 

I would think it's generally not a good idea to copy them to the root level, unless you can be sure they're all unique and they have unique identification properties. They're in a hierarchy for a reason 😉


--------------------
QA Systems Architect
Integrated Control Technology
https://www.ict.co/

View solution in original post

3 REPLIES 3
Highlighted
Community Manager

Re: Any pitfalls with making most of the aliases on the root level?

Thanks for your question @ackmondual !

 

@AlexKaras  @anupamchampati @BenoitB @tristaanogre , any advice?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Contributor

Re: Any pitfalls with making most of the aliases on the root level?

Are you using keyword tests or scripting? If you're writing scripts you can assign your name mapping to variables, making that the new root.

e.g. mainPage = Aliases.App.HwndSource_Window.Window.MainFrame.MainPage;

 

You can do this for keyword tests by setting a project-wide variable and using that.

 

I would think it's generally not a good idea to copy them to the root level, unless you can be sure they're all unique and they have unique identification properties. They're in a hierarchy for a reason 😉


--------------------
QA Systems Architect
Integrated Control Technology
https://www.ict.co/

View solution in original post

Highlighted
Community Hero

Re: Any pitfalls with making most of the aliases on the root level?

Hi,

 

 if there's anything I should be aware of

Nothing that I can think of. (Obviously, given that aliased names are unique.) Actually, this is one of the purposes of Aliases: to make mapped objects' tree to be less deep and be more convenient for use in test code.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors