cancel
Showing results for 
Search instead for 
Did you mean: 

Testedapps.app.Run() does not return in TC 14

SOLVED
Highlighted
Contributor

Testedapps.app.Run() does not return in TC 14

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.

 

sincerely

P. Vinders

SOPTIM AG, Germany

1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

Re: Testedapps.app.Run() does not return in TC 14

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 :-)

 

sincerely

P. Vinders

SOPTIM AG

Germany

10 REPLIES 10
Community Hero

Re: Testedapps.app.Run() does not return in TC 14

More information on what the application is that you're running, how you have the command line configured, etc.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Testedapps.app.Run() does not return in TC 14

Thanks for replying!

 

Additional information:

 

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

 

 

Contributor

Re: Testedapps.app.Run() does not return in TC 14

Thanks for replying!

 

Additional information:

commandline = C:\Program Files\SOPTIM AG\SOPTIM\run.cmd

 

run.cmd starts java with additional parameter

Community Hero

Re: Testedapps.app.Run() does not return in TC 14

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?

https://support.smartbear.com/testcomplete/docs/app-testing/desktop/java/adding-to-tested-apps.html#...


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Testedapps.app.Run() does not return in TC 14

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.

 

Contributor

Re: Testedapps.app.Run() does not return in TC 14

Your suggested approach seems to work.

 

What is the difference with the 'old' one (application not in the code, but in testedapps)?

 

Community Hero

Re: Testedapps.app.Run() does not return in TC 14

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.

 

Thanks!


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Testedapps.app.Run() does not return in TC 14

With TC11 it worked with the run.cmd-approach. Strange don't you think?

 

But anyway, many thanks for your solution!

 

sincerely

P. Vinders

Community Hero

Re: Testedapps.app.Run() does not return in TC 14

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.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
New Here?
Join us and watch the welcome video:
API Testing Mistake #2
APITestingMistake#2
Top Kudoed Authors