I have a created a static class MyGlobalVariables in my Test Studio project to hold 10 global variables.
I have then created a Web Test MyTenTests which is made of 10 Test as Step scripts.
I have bound a datasource (an XML file) with Global Values to MyTenTests test
I want to extract the Global values and store them in MyGlobalVariables.variable1, MyGlobalVariables.variable2, .. MyGlobalVariables.variable10 for use in the whole project.
The idea is to set the values in the XML file once per project and make the values available throughout the project.
Ideally this would be done for a Project or TestList but that is not currently an option so I am using Test as Step as a workaround.
Note the class is within the namespace not the individual tests.
Declaration
public static class MyGlobalVariables
{
// Set project specific global variables
public static string MYURL= (string) Data["MYURL"];
public static string MYToolsReminders= (string)Data["MYToolsReminders"];
public static string MYCountVisitorsToURL= (string)Data["MYCountVisitorsToURL"];
}
Usage
The error mesaage is :
The name 'Data' does not exist in the current context