Differences between variables and parameters?

Ask general questions here.
Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Differences between variables and parameters?

Post by Fergal » Tue Aug 19, 2014 12:12 pm

What are the main differences between variables and parameters, in Ranorex tests?

How do we know when to use one and not the other?

Thanks!

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

Re: Differences between variables and parameters?

Post by krstcs » Tue Aug 19, 2014 1:27 pm

It depends a lot on the language you are talking about. Ranorex is built on .NET, so the .NET definitions hold.

Parameters are values passed INTO something, such as a method or the application itself (from the command-line). Parameters define the starting conditions of some functionality.

Variables are areas of memory designated to store variable values (i.e. values that might change) at run-time. Variables usually store values that represent an object or its state in object-oriented languages like .NET.

Variables can be passed into methods as parameters, and parameters passed into methods can be stored into variables.

In Ranorex, global and test-case parameters are treated like global or test-case level variables in many ways. They are sets of values that are generally static at the start of a test but then can be updated during the run in order to pass values between test-cases or modules.
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Differences between variables and parameters?

Post by Fergal » Wed Aug 20, 2014 9:30 am

Thanks very much krstcs, your answer is just what I needed. I was asking the question in relation to Ranorex data driven tests.

dinad578
Posts: 1
Joined: Thu Sep 04, 2014 6:11 am

Re: Differences between variables and parameters?

Post by dinad578 » Thu Sep 04, 2014 6:43 am

It was very informative explanation. One can easily understand the difference of parameter and variable relation to Ranorex data driven tests.