Predefine usercode paramters

Best practices, code snippets for common functionality, examples, and guidelines.
florian.mautendorfer
Posts: 4
Joined: Fri Dec 15, 2017 11:50 am

Predefine usercode paramters

Post by florian.mautendorfer » Wed Dec 12, 2018 2:52 pm

Hi everyone,

I am just starting to build one central user code file for our tests and in the process found out that it would be best if i could predefine which pramaters can be given.
In my research i found enums in c# but am not sure if it works or is the way to go.
Could one of you maybe give me a hint? Would be really appreciated!

BR
Florian

User avatar
N612
Posts: 64
Joined: Mon Jul 11, 2016 4:01 pm

Re: Predefine usercode paramters

Post by N612 » Fri Dec 14, 2018 9:32 pm

It is hard to say without more information, but why not keep things simple and use global parameters in Ranorex? These can be accessed in code by data-binding them to your variables or accessing them directly via the code snippet below.

Code: Select all

IDictionary<string, string> allParams = TestSuite.Current.Parameters;