TestComplete and JScript how to structure code

TestComplete website has many snippets of JScript on its support sites, but I am seeking examples of a more OO approach to using Jscript within TestComplete.

Most JScript code to me appears to be written more inthe functional VBScript style.

Really, I’m looking for a best practice guide but can’t find much..

—-

Note its quite clear how to share common functionality in individual JScript units (files) across Project Suites/Projects in TestComplete, just not how to structure JScript within a unit for maximum reuse.

And Jscript seems to me to me to be so loose, in that it allows you to write functional style, OO style and mix and match.  (Too loose in my Javascript Noob opinion)

Parsing an XML file 20150208

TestComplete has an example of parsing an XML file out to the TestComplete log.

It will be a useful javascript learning exercise to extend this to parsing the xml to a javascript object tree , with recursive finder functions.

Probably so many bad practices evident in here… It creates a tree structure of type XMLNode which is recursed just for fun in the finder functions. Continue reading