Forum Discussion

mattc_1's avatar
mattc_1
Occasional Contributor
15 years ago

RunRoutine Executes Slow

I am wanting to use Visual Studio 2008 to handle the flow of my tests. I have created scripts that allow me to pass in the control name and the value to be used into a sub and it will set the value. I found that RunRoutine and RunRoutineEx are the only two functions that will do this from VS.



I am noticing though that it takes a while to execute these and even though it is a COM reference and not .Net it feels a bit clunky. Take for instance I am calling a piece that will close the open form using ALT + F4 which seems to close the form in a few seconds but it will not exit out of the sub for another 5-10 seconds after it has already closed the form.



Is this just the way it is going to be or is there something wrong with the way I have initialized my TestCompleteApplication and ItcIntegration variables?



I am setting them using the Marshal.GetActiveObject or Activator.CreateInstance functions to initialize the TestCompleteApplication variable.



Is there a better way to do this?

  • Hi Matthew,





    The RunRoutine and RunRoutineEx methods start the test execution and call the specified routine. I think that you should not start the execution every time you want to call a routine. If TestComplete is in the playback state, you can call a routine by using the 'Runner.CallMethod' method. You can find information on this method in the Runner.CallMethod help topic.





    If you are working with TestComplete from a Connected application, you can use the RunTest method to put TestComplete into the playing state. All run-time objects are accessible via their names in Connected applications. Please find more information in the 'Running Connected and Self-Testing Applications' help topic.





    If the application you are working with is not a Connected application, you can run a routine with an endless loop by using the RunRoutine method and then call the needed script routines in the following way:

        ' The Runner object can be obtained only if a test is being executed

        Dim Runner As Object = IntegrationObject.GetObjectByName("Runner")





        ' Calling a script routine

        Call Runner.CallMethod("Unit1.TestArrParam", props, vals)