Testedapps.app.Run() does not return in TC 14
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
More information on what the application is that you're running, how you have the command line configured, etc.
Robert Martin
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for replying!
Additional information:
commandline = C:\Program Files\SOPTIM AG\SOPTIM\run.cmd
run.cmd starts java with additional parameter
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your suggested approach seems to work.
What is the difference with the 'old' one (application not in the code, but in testedapps)?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With TC11 it worked with the run.cmd-approach. Strange don't you think?
But anyway, many thanks for your solution!
sincerely
P. Vinders
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
