Question

I am using Testcomplete software and C# scripting.

I am able to read the data from the excel but I am not able to put them in a dictionary.So seeking help.

Was it helpful?

Solution

C#Script is based on the Microsoft JScript language (the same as JavaScript). Objects in this language behave in the same way as Dictionary objects and so you can use this functionality without any problems:

  var dict = new Object();
  dict["MyKey1"] = ["Obj1Val1", "Obj1Val2"];
  dict["MyKey2"] = ["Obj2Val1", "Obj2Val2"];
  dict["MyKey3"] = ["Obj3Val1", "Obj3Val2"];
  Log.Message(dict["MyKey2"][1]);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top