Ask a Question

Getting units and routines in script

john_qa
Occasional Contributor

Getting units and routines in script

Hello,



Is there a way to obtain in a script, the list of units from the project, or the list of routines and their units?



I've searched the documentation and i haven't found anything regarding this.



What I'm trying to do, is to call routines in Main unit without previously knowing its name, so adding new routines in new units doesn't force me to change the Main unit in order to allow me to execute them. 





Thanks,

John



just testing...
2 REPLIES 2
tristaanogre
Esteemed Contributor

As far as I am aware, no, there is no way of doing so.



However, I would suggest that you can get away from having a "Main" unit that executes your code and, instead, utilize Test Items at the project level to execute new tests and routines.  Read up on the help topics for test items but you'll find that you'll be able to create a method and then access it directly via the test item in order to execute it when you run your project. 

Robert Martin
[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
Extensions available
john_qa
Occasional Contributor

Thank you very much for the advice.



For me using TestItems is not an option, and I think I'll obtain the units by simply reading the files from Script folder and maybe reading their content and parse it to obtain the routines in the Main routine.



Regards,

John
just testing...
cancel
Showing results for 
Search instead for 
Did you mean: