Find and Use a Sibling Object Starting from an AliasChild Object
- 24 days ago
Alright, figured it a solution. Though I doubt this is the optimal method
So to get the actual Parent Object, it needs to use ".parentNode" (or ".parentElement"), though as this is browser based javascript element, it does not create the "TestComplete Object", hence using this will cause parent.Exist == false. So once I have gone up enough levels to reach the parent I want (in the example it's only the one level), I can then take the class of the object (that changes every run with Electron's Code Obfuscation), do a WaitElement searching for an element with that Class Name, and then I can do the WaitPanel to find the desired object.For Example:
let anchorobj = [PathToProcess.Page].WaitAliasChild("MappedName", 1000);
let parentclass = anchorobj.parentElement.className;
let parent = [PathToProcess.Page].WaitElement("contains(@class, '" + parentclass+ "']", 1000);
let desiredobject = parent.WaitPanel(0, 1000);I'll leave this open for a couple days in case anyone knows a more optimal solution