I am working on a rather large AUT, and have split my regression suite across multiple test suites in a single project.
There are some variables that I would like to use between all of the tests suites, such as username, or version number.
Is it possible to set a global parameter in a single place, and have it shared between the multiple test suites?
Using global parameters across test suites
Re: Using global parameters across test suites
That's something I've started doing too - multiple Test Suites - and have a similar problem with duplicated parameters. "Truly Global Parameters" sounds like a good idea, one for the Ranorex UserVoice perhaps? I'd vote for it.
Re: Using global parameters across test suites
So, until that becomes a feature.... Is there a way I can do this programatically? We have a rather large AUT, and I'd like to be able to break the sections into different suites, and use just a single set of variables.
Re: Using global parameters across test suites
For those interested, I came up with a simple solution
First, I create a simple class file, I called it GlobalParameters.cs, that just looks like this:
Then, I created a user code module to set the parameter. I insert a module variable called "Version", and then in the run section, just add this:
Now, all I have to do is create a global parameter in the test suite I am working on, add the user code to the setup for the whole suite, and bind the variable in the user code module to the global parameter for Version.
Now, the parameter will be given the value in the GlobalParameters file, and I can change it in that file to affect all of my test suites.
First, I create a simple class file, I called it GlobalParameters.cs, that just looks like this:
Code: Select all
using System;
namespace MyTest
{
public class GlobalParameters
{
public static string Version = "88.54.0.1";
}
}
Code: Select all
Version = GlobalParameters.Version;
Now, the parameter will be given the value in the GlobalParameters file, and I can change it in that file to affect all of my test suites.
Re: Using global parameters across test suites
That is a very nice solution! Could you put it in the how-to section of the Forum?