I need to detect if current running autoit script is failed or not.
I tried to wait for 1 min in the following code, if in this time 1st Autoit script doesn't complete then it will move on to 2nd script but in the output Console it will show that 1st Script is Passed.
@Test (priority=1)
public void CreateNew() throws Exception
{
Process process = Runtime.getRuntime().exec("exeFiles\\CreateNew.exe");
process.waitFor(1, TimeUnit.MINUTES);
}
Is there a Way to detect wheather the following script is failed?
Possible Solution can be :
- Is to detect wheather script is skipped/stoped due to
process.waitFor(1, TimeUnit.MINUTES)
and if it is so then fail the script.
So Can any one suggest me a solution for this Issue or a way to Implement the above Possible Solution?