mercredi 18 mai 2016

Closing all open command prompt leads to error in forked process in testNG

I am using testNG for mobile automation and I want to close multiple command prompts(appium servers) which i launched. For this, I am using the below code

@AfterSuite
    public void closeCommandPrompts() throws IOException, InterruptedException{
    System.out.println("After suite");
    Thread.sleep(8000);
    Runtime.getRuntime().exec("taskkill /F /IM node.exe");
    System.out.println("closed node.exe");

The last two lines if I commnet it out works fine, however if they ar not commented it gives an error in the forked process.

I guess testNG is internally using command promptwhich i am trying to close when iam using taskkilll in @aftersuite.

Please help me in getting some work around.

Aucun commentaire:

Enregistrer un commentaire