Ask a Question

How to call an external program with different argument every time?

pvidal
Contributor

How to call an external program with different argument every time?

Hello,



I am using JScrip for our tests cases.



I need to call an external program with different arguments every time. I added the program to the TestedApps and I set the Params.SimpleParams.CommandLineParameters property with the arguments and then call the Run() method of the application. The problem with this approach is that when I set the Params.SimpleParams.CommandLineParameters property it changes the project file that it is in source control and TestComplete needs to check it out every time to be able to run the tests. 



Is there another/correct way to do this?



Thank you,

Patricio.
2 REPLIES 2
YMinaev
Staff

Hi Patricio,



You can start your application without using TestedApps in this case. For example, you can do this via the Run method of the WScript.Shell object.

------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
pvidal
Contributor

Hello Jared,



Thank you for your answer. It was very simple after all:




    var shell = new ActiveXObject("WScript.Shell");

    var errorCode = shell.Run(command, 1, true);


Thank you,

Patricio.

cancel
Showing results for 
Search instead for 
Did you mean: