Using Global variable as Path for Data Source

Class library usage, coding and language questions.
Posts: 1
Joined: Fri Nov 02, 2018 3:07 pm

Using Global variable as Path for Data Source

Post by mcarolo » Fri Nov 02, 2018 3:18 pm


It's my first post here, and I wanted to start with a generic "Hello", seems nice and good.
I'm a developer from Italy, recently approaching Ranorex. So, not a lot of knowledge about testing, but a lot about programming.

I'm taking a leftover suite implemented by a tester with Ranorex, and trying, in order to better understand the product and get my own package of knowledge to "rewrite" the existing test suite, implementing my own version of the existing test suite and trying to optimize it at my best using the top of the developer skills I have.

This all to ask you a simple question, as written inside the title.

Is it possible to set a Data Source from a path defined as a global variable inside the solution?

I want to make the testing solution as flexible as possible, and that will help a lot. I've a lot of data sources inside an external folder...

Thanks for any reply, and greeting from Italy!

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

Re: Using Global variable as Path for Data Source

Post by odklizec » Mon Nov 05, 2018 9:15 am

Hi mcarolo and welcome here. As far as I know, there is no way to use a global parameter as a variable in data connector settings dialog. The only way would, most probably, be using dynamic loading of data connectors via code? But I think this would require a lot of unnecessary work and potential source of issues? Anyway, you can use relative paths in data connector settings. So if you are concerned about absolute paths, simply replace them with relative counterparts.
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