Forum Discussion
AlexanderM
14 years agoStaff
Hello Aleksey,
There is no ideal solution to this task. Possible approaches can be:
1. Instead of using the Main routine, call each routine specified in a file from an external .js script file (you can create it with Notepad). The contents are as follows:
Close TestComplete before executing this file.
2. Manually add to and move test items in the Test Items collection of a project and control whether a test item needs to be run (enabled / disabled) or stopped on error from an external .js file. For more information, refer to the Automating TestComplete With the Integration Object section of the Working With TestComplete via COM - Overview help topic and the ProjectTestItem_COMAccess Object help topic.
There is no ideal solution to this task. Possible approaches can be:
1. Instead of using the Main routine, call each routine specified in a file from an external .js script file (you can create it with Notepad). The contents are as follows:
var TestCompleteApp, IntegrationObject, FS, F, s;
TestCompleteApp = WScript.CreateObject("TestComplete.TestCompleteApplication");
IntegrationObject = TestCompleteApp.Integration;
TestCompleteApp.Visible = true;
IntegrationObject.OpenProjectSuite("C:\\ProjectSuite1\\ProjectSuite1.pjs");
FS = WScript.CreateObject("Scripting.FileSystemObject");
F = FS.OpenTextFile("C:\\RoutineList.txt", 1); //the RoutineList.txt file contains the list of the routines
while(! F.AtEndOfStream){
while (IntegrationObject.IsRunning())
{}
s = F.ReadLine();
IntegrationObject.RunRoutine("TestProject2", "testUnit", s);
}
F.Close();
Close TestComplete before executing this file.
2. Manually add to and move test items in the Test Items collection of a project and control whether a test item needs to be run (enabled / disabled) or stopped on error from an external .js file. For more information, refer to the Automating TestComplete With the Integration Object section of the Working With TestComplete via COM - Overview help topic and the ProjectTestItem_COMAccess Object help topic.
Related Content
- 5 years ago
- 14 years ago
- 2 years ago
Recent Discussions
- 2 days ago