Contributions
Re: TestComplete javascript implementation of an Dictionary object bugged.
Seeing as getActiveXObject wasn't in until 12.4, I wouldn't expect it to be in your 12.3 build. The JavaScript tab was changed on 12/19/2017 at 7:21am according to the inspect information, which was after I attempted to use it. Page doesn't need to update if the link is updated separately. Thanks for the info on the $get, $call.2.1KViews0likes0CommentsRe: TestComplete javascript implementation of an Dictionary object bugged.
That was a direct paste from the website for the javascript (JScript doesn't use 'let') ... seems the website had been updated since I had been experimenting with it. It's an odd mix, however, you don't need $call for Exists, Remove, ect and you don't need to use $get either ... seems only to be the $set that is required in this implementation.2.1KViews0likes2CommentsTestComplete javascript implementation of an Dictionary object bugged.
The code example they give for the new "getActiveXObject("Scripting.Dictionary")" implementation of a dictionary is as follows: function DictionaryDemo() { let d = getActiveXObject("Scripting.Dictionary"); // Add keys and items. d.Add("a", "Alphabet"); d.Add("b", "Book"); d.Add("c", "Coffee"); // Get the item by key. var s = d.Item("c"); Log.Message(s); // Assign a new item to the same key. d.Item("c") = "Cookie"; s = d.Item("c"); Log.Message(s); // Assign a new key to the same item. d.Key("c") = "Co"; // Remove second pair. d.Remove("b"); if (d.Exists("b")) Log.Message("The pair exists.") else Log.Message("The pair does not exist.") } This code breaks in a couple of places. The line 'd.Item("c") = "Cookie";' gives the following error: JavaScript runtime error. ReferenceError: Invalid left-hand side in assignment. The line 'd.Key("c") = "Co";' gives the following error: JavaScript runtime error. Error: Member not found.Solved2.2KViews0likes4Comments