Hi,
What happens if I modify (in code) a variable (bound to a parameter)?
As module variables are normal properties you can also use them like properties. That means if you set the variable to another value (in code at runtime) the new value will be taken instead of the value of the global parameter.
What happens if I modify (in code) a parameter (is this possible?) to which a variable was bound?
This is possible but not recommended.
You can set or create global parameters at runtime, but you have to make it before the specific TestCase, where you have bound the variables, is called.
TestSuite.Current.Parameters.Add("GlobalParam3", "30"); //creates a new one
TestSuite.Current.Parameters["GlobalParam2"]="30"; //overrides the parameter with the specific name
var testSuite = (TestSuite)TestSuite.Current;
var testCase = (TestCase)TestSuite.Current.GetTestCase("TestCase");
var testSuiteModule = testCase.AllModules[0]; // the first module from the specific test case
testSuiteModule.AddDataBinding(new ModuleVarItem("variable1", new Guid("07bef6aa-2cd3-4ac5-92de-ae42bc078ccf"), "Recording1", ""),
new ParameterDataBindingInfo("GlobalParam3",
testSuite.TestSuiteEntry.Id.ToString(), (TestCase)TestCase.Current));// the new data binding, variable1 is the variable from the specific recordingKind Regards,
Markus
Ranorex Support Team