Search code examples
automated-testsenvironment-variablesranorex

How can i use enviromental variables in Ranorex?


I want to automate some tests, which require me to log in to a webpage. I used intellij and selenium so far, and there i could easily set enviromental variables to avoid pushing sensitive stuff to github. I wanted to give a try to Ranorex, and so im kinda unfamiliar with it, but i couldn't find a way to implement env variables. What could/should be my solution to using sensitive data without publishing them?


Solution

  • Ranorex studio user code is standard .NET (C# or VB.NET depending on your preferences).

    You can use System.Environment.GetEnvironmentVariable(String) and SetEnvironmentVariable(String, String).

    See Microsoft web site for information: https://learn.microsoft.com/en-us/dotnet/api/system.environment