Page 1 of 1

How to use global variables in new Ranorex 3.x

Posted: Wed Sep 14, 2011 9:37 pm
by slavikf
With all that new structure introduced in Ranorex 3.0,
how i work with Global variables?

For example, in one test case, i'll get path of some file.
Then, in every test case after that, i want to use that path. How and where should i declare that global variable, so that it is available from user code in every test case?

BTW, i do not need any binding.

Re: How to use global variables in new Ranorex 3.x

Posted: Thu Sep 15, 2011 8:46 am
by dman
I'm also interested in this topic (have basically the same problem http://www.ranorex.com/forum/global-par ... tml#p10434) and I would be grateful for a solution to this matter.

All the best,
D.

Re: How to use global variables in new Ranorex 3.x

Posted: Thu Sep 15, 2011 10:05 am
by dman

Re: How to use global variables in new Ranorex 3.x

Posted: Tue Oct 11, 2011 1:54 pm
by Pixi6s
Wouldn't it be easier to use the repository variables, at least if you are using the repo in general.

Re: How to use global variables in new Ranorex 3.x

Posted: Tue Oct 11, 2011 2:25 pm
by Todor
Using Global Parameters is very easy. First you have to create them (i hope you know how you do that) and then you'll have to bind them to a variable.

Assign the global parameter to the variable you want to run with the fortune value of the global parameter.

To use it in your test you will have to start your Test per commandprompt

1.) open the cmd
2.) <path to the executable test> /pa: <name of global parameter>=<value of the global parameter>
3.) execute the command

For not always opening the command prompt you can wirte a batch file to execute your test:

Code: Select all

@echo off

<path to your executable test> /pa: <name of global parameter>=<value of the global parameter>
Or you can simply use the default value of the parameter. Works fine too.

if you have more than one global parameter, just add another /pa: <name>=<value>