Forum Discussion

sriram_sig's avatar
sriram_sig
Contributor
6 years ago
Solved

Adding dictionary object to project variables

i have a requirement to automate a web project and i fould it to be easier to work with xpath rather than the properties in name mapping. So i thought of adding the variable name and xpath like a key...
  • tristaanogre's avatar
    6 years ago

    The first parametre of "AddVariable" is the name of the variable

     

    Change your code to 

     

    d = Sys.OleObject["Scripting.Dictionary"]
    
    d.Add("a", "Alphabet")
    d.Add("b", "Book")
    d.Add("c", "Coffee")
    Project.Variables.AddVariable("Dictionary", "Object")
    Project.Variables.Dictionary = d;