Running Selected Project Test Item(s) from Script
We would like be able to select which tests to run in different environments without having to login on each one of them and select the project test items to run. Automatic update of project suites in each environment is of course necessary and we have that.
We would like to have different top items in project test items view, like "Staging" and "Production" to select the tests for each environment. Since it is not possible to launch specific project test items from command line, we thought we could have special routines like "RunStaging" and "RunProduction" that we call from command line, each one programmatically pointing to the top project test item we want to run. However, even though it is possible to progarmmatically access project test items, it is not possible to execute a specific item (or set certain sub items enabled before "running the project").
I know we could call the tests we want to run from a start routine as described above but we like the nice overview we get with the project test items view. Any ideas?
I changed the subject from "Programmatically Selecting the Project Test Items to Run" to "Running Selected Project Test Item(s) from Script" which is a more exact description of what I want to do.
We have now found a solution to the problem. It is possible from script to iterate over project test items and get to the information about which script unit/routine each item is associated with. At least in Python, we can then dynamically import the module (script unit) where the test resides and execute a specific method (routine) that runs the test.