X path without using repository

Ask general questions here.
Balaraj
Posts: 7
Joined: Wed Jun 08, 2016 2:07 pm

X path without using repository

Post by Balaraj » Fri Jun 10, 2016 8:35 am

hi,without repository is it possible to get the X path of an item??

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: X path without using repository

Post by odklizec » Fri Jun 10, 2016 12:25 pm

Hi,

I'm afraid, I don't have a clue what you want to do? Could you please describe in more details what exactly you want to achieve?

You can get the element xpath using Ranorex Spy and then use the obtained path in code. Eventually, you can search for elements via code. But to be quite honest, I don't see a reason why would anyone drop the existing repository functionality and code everything from scratch? ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Balaraj
Posts: 7
Joined: Wed Jun 08, 2016 2:07 pm

Re: X path without using repository

Post by Balaraj » Fri Jun 10, 2016 12:46 pm

Just have a thought of building a framework without using repository,that's it :)

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: X path without using repository

Post by krstcs » Fri Jun 10, 2016 1:57 pm

It is possible to find elements without using the repository.

However, in my opinion, the repository is one of the key reasons for using Ranorex. It separates the test actions from the paths to the elements so you can change one without affecting the other.

In addition, Ranorex IS a framework. Why re-invent the wheel? I can do everything I need to do within Ranorex without having to write my own framework, and I do a lot of custom work. I think it would be wasting time building a framework instead of writing tests.

If there is something that you need from Ranorex that you can't figure out, ask here and we will try to help. If it's something that Ranorex doesn't do, send an email to the Ranorex team ([email protected]) with your feature request and they will see if they can support it.
Shortcuts usually aren't...

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: X path without using repository

Post by Aracknid » Tue Jun 14, 2016 1:55 pm

Just for a different point of view, I don't use the repository, and code everything myself. The reason I do this is for historical reasons (was porting from another automation tool to Ranorex), and also because at the time I started using Ranorex (version 3 timeframe), I found it difficult to use the repository with a team of automation coders and visual studio. Documentation was lacking on best practices.

Some of the pros of not using the repository are 100% complete ability to control everything in your own code yourself. Also, while I love Ranorex and plan to continue using it for as long as possible, I've not locked myself into too much reliability on them, a lesson I learned years ago from using other tools. Coding everything myself in Visual Studio and only using the Ranorex API for UI interaction and a few other things makes moving to another tool much easier should that ever need to be done.

Some cons are, as already stated, you need to spend some more time creating code to handle things yourself. Depending on your skill level, could be only a few days or a few weeks.

How it works for me is as follows: I code everything in Visual Studio, and use continuous integration to make my build (of scripts and a framework). I've written various in house programs to grab the latest build of scripts and execute them across various VMs. When a script fails due to a change in UI that requires a change to an x-path, I simply modify the existing file, check it in, CI kicks in, grab latest build, and re-run. Or I can manual run it from within Visual Studio after the fix to get the run sooner if need be.

I've got an web based client/server app as my AUT, so each ASP/ASPX page/dialog is a class in code, and within this class I've defined all the UI elements and their x-paths. So a change only needs to be made in one place.

If you're starting out with Ranorex now with nothing existing from previous automation tools, or no experience with automation, you should definitely look at doing things by using the repository. They've made many improvements with it since I started with version 3, such as making it easier to work with, with multiple people on your automation team. Other people can fill you in on this, as I'm not the right person for that.

Aracknid.