Accessing global variables
Posted: Mon Sep 21, 2015 11:37 am
1. In the suite, we have created a global parameter username
2. In a test case, we have inserted a usercode to read the value from the excel sheet (not excel connector, adodb connection)
we need to assign the value of username(global parameter) in the usercode that is read from the excel sheet
we are able to read the value but while assigning it to the global parameter
TestSuite.Current.Parameters["username"] = TD.Rows[0]["sUname"].ToString();
an error is thrown
Please let us know a way to read the data from excel and assign to global variable and use this variable in the recorded steps or usercode
2. In a test case, we have inserted a usercode to read the value from the excel sheet (not excel connector, adodb connection)
we need to assign the value of username(global parameter) in the usercode that is read from the excel sheet
we are able to read the value but while assigning it to the global parameter
TestSuite.Current.Parameters["username"] = TD.Rows[0]["sUname"].ToString();
an error is thrown
Please let us know a way to read the data from excel and assign to global variable and use this variable in the recorded steps or usercode