As a long time tester with TC 11 and jscript, we now use TC 14 for Testing our desktop application (we have downloaded the trial version and run the 32-bit Version of TC). System is Windows 7, with Windows 10 in the nearer future planned. But now we are having problems with running the entries in TestedApps:
var appl = TestedApps.Application.Run();
does not return anymore!?! TC is waiting for the application to be closed, which is not the purpose of the command.
What could be the reason for this behaviour? This is a no-go for us unfortunately.
SOPTIM AG, Germany
Solved! Go to Solution.
I've added a JavaTestedApp-Entry per TestedApp-Editor instead of a 'normal' TestedApp-Entry and I'm able to use TestedApps.Application.Run() in jscript-code like before in TC11.
Thanks for the advise and 5-stars rating for it :-)
More information on what the application is that you're running, how you have the command line configured, etc.
Thanks for replying!
Commandline = C:\Program Files\SOPTIM AG\SOPTIM\run.cmd
and run.cmd =
"C:\Program Files\Java\jre1.8.0_192\bin\java" -Dlog4j.configuration=file:./log4j.xml -Xmx512m -Dremote.connection.default.host=xyz -Dremote.connection.default.port=8080 -Dstring.application.ear.name=de.soptim -jar "SOPTIM.exe" -cp lib -splash:/images/splashScreen.png
Thanks for replying!
commandline = C:\Program Files\SOPTIM AG\SOPTIM\run.cmd
run.cmd starts java with additional parameter
If it's a Java app, while I understand that the run.cmd has worked in the past, I believe there's a "preferred" method of doing so. Have you looked at implementing the following?
If run.cmd =
"C:\Program Files\Java\jre1.8.0_192\bin\java" "-javaagent:C:\Program Files\Java\jre1.8.0_192\..\qs-agent.jar" -Dlog4j.configuration=file:c:\SOPTIM\log4j.xml -Xmx512m -Dremote.connection.default.host=xyz -Dremote.connection.default.port=8080 -Dstring.application.ear.name=de.soptim -jar "c:\SOPTIM\SOPTIM .jar" -cp c:\SOPTIM\lib -splash:c:\SOPTIM\images/splashScreen.png
then is the next correct?
app.JVMExecutable = "C:\\Program Files\\Java\\jre1.8.0_192\\bin\\java";
app.JarFileName = "c:\\SOPTIM\\SOPTIM.jar";
app.WorkFolder = "C:\\SOPTIM";
app.Options = "-javaagent:C:\\Program Files\\Java\\qs-agent.jar -Dlog4j.configuration=file:C:\\SOPTIM\\log4j.xml -Xmx512m -Dremote.connection.default.host=xyz -Dremote.connection.default.port=8080 -Dstring.application.ear.name=de.soptim-cp C:\\SOPTIM\\lib -splash:C:\\SOPTIM\\images\splashScreen.png";
app.ApplicationArguments is empty.
Your suggested approach seems to work.
What is the difference with the 'old' one (application not in the code, but in testedapps)?
Technically speaking, run.cmd is not returning until all the "code" within the CMD file completes execution. Similarly it would be with a batch file with multiple commands. That BAT file does not "return" immediately. By executing via the indicated method, it actually has TestComplete look at the JVM and other files for indication of execution completion.
If my solution fixed your problem, please mark it so that others looking for the same solution can find it.
With TC11 it worked with the run.cmd-approach. Strange don't you think?
But anyway, many thanks for your solution!
TC 12 and TC 14 have had changes made to the TestedApps processing to make it work with a larger variety of application so, while it may have worked in TC 11, I'm not 100% surprised adjustments needed to be made for later versions.