Adding method to "testobj"
From what I've been able to find so far, it seems like accomplishing this would take a script extension. Is this correct, or is there some way to do this in an ordinary script unit? If a script extension is necessary, would anyone be willing to give me a few pointers on how to get started on it? I currently have no experience with that particular functionality.
I can post the code I currently have for the Locate function if necessary; I don't think it should be though.
Thanks in advance for any help you can offer!
Solved! Go to Solution.
var testObj = Aliases.MyApp.MyForm
Now, what you COULD do is write a bit of code to do something like this
var testObj = new myWrapper()
Basically, the "myWrapper" class would contain code that would go through ALL the methods and ALL the properties of the Aliased object, replicate them within the testObj instance, and then tack on your Locate method and any other methods you would want to add. But, honestly, that feels like re-inventing the wheel. The solution you've come up with (passing the object as a parameter) is probably the best as it is minimal extra code and doesn't end up with a confusion of whether or not you're calling the wrapped version of the object or the actual object itself. Just seems like a lot of work for very little benefit.
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Ouch, that's unfortunate. Locate performs some of the same functions as Find, so I was hoping to have a nice readable "Parent.Find(ChildProps).Find(ChildProps)" structure to my code rather than the current confusing "Locate(Locate(Parent, ChildProps), ChildProps)" format. Still, if that's what it takes, that's what I'll do.
Thank you very much for your help!