Check if an external program is run

Hi all
Is it possible to check if an external program runs?
When I click a ‘print’ button, my app opens a pdf reader. Is it possible to verify that the pdf reader is running.
And is it possible to check if the resulting pdf contains a certain text?

Hi Mate,

Great question… I’m going to need to do something similar at some point…

Is it possible to check if an external program runs?

Well, I’m not certain about this but if you’re using an external executor (Runtime.runtime.exec, for example) then I suspect the process returned will get you some information – maybe even the information you (we) require. I’m not an expert on any of this stuff but maybe somebody reading this is and will chime in with a fuller answer.

This was pasted directly from Katalon Studio – the formatting is suffering from the forum and javadoc not liking each other too much :wink:

Process java.lang.Runtime.exec(String command)

  • exec

    public Process exec(String command)             throws IOException

    Executes the specified string command in a separate process.

    This is a convenience method. An invocation of the form exec(command) behaves in exactly the same way as the invocation exec(command, null, null).


    command - a specified system command.


    A new Process object for managing the subprocess


    [SecurityException]( - If a security manager exists and its checkExec method doesn’t allow creation of the subprocess

    [IOException]( - If an I/O error occurs

    [NullPointerException]( - If command is null

    [IllegalArgumentException]( - If command is empty

    See Also:

    exec(String[], String[], File), ProcessBuilder

@Katalon Team

Seems editing of one’s own posts is broken…


@Russ Thomas

Thanks. However, this seems like a task a bit out of my league, for now. I had a chat with developers and for now we are leaving this test for manual testers.