I need to invoke a Java program inside a sensetalk script or from EggPlant. Is there any possibility for doing the same?
Asked
Active
Viewed 990 times
1
-
I haven't worked with eggPlant before (first time I've heard of it!), but I found [these docs](http://docs.testplant.com/?q=content/using-eggplant), with a Java example. Is that what you're looking for? Is there anything in those docs you don't understand? – yshavit Dec 22 '16 at 07:14
2 Answers
2
There is no built in mechanism for doing this. If you can package your java code as something that can be invoked through the command line you can use EggPlant's shell
command to run the Java code as if it was invoked through the shell.
I know this is a clunky solution especially if you are wanting to pass data back and forth between Java and EggPlant but that's the only solution I was able to come up with when I was working with EggPlant.
http://docs.testplant.com/ePF/SenseTalk/stk-system-interaction.htm

sphennings
- 998
- 10
- 22
2
set destinationFile to "/Users/username/eggPlantTemp.txt"
shell "java -jar /Users/username/IdeaProjects/S3_tests/target/S3_tests-1.0-SNAPSHOT.jar ios > " & destinationFile
LogSuccess file destinationFile
You can use shell. This command will execute jar (with parameter "ios"), record output in a file and then will show the file in eggPlant log.

Daniel Miakotkin
- 121
- 5