I want Selenium to wait until and unless an AutoIt script is completed.
Right now whats happening is when I run the TestNG.xml
file it runs all the @Test Priority wise and within 5 sec the TestNg output console shows all the @Test are passed.
While my AutoIt scripts are still running in parallel in the background.
The code is as follows:
@Test (priority=1)
public void CreateNew() throws Exception
{
Runtime.getRuntime().exec("exeFiles\\CreateNew.exe");
}
@Test (priority=2)
public void OpenaFile() throws Exception
{
Runtime.getRuntime().exec("exeFiles\\OpenaFile.exe");
}
The AutoIt code is as follows:
createnew()
Func createnew()
Sleep(2000)
Run("Mspaint.exe")
WinWaitActive("Untitled - Paint")
Send("!f")
Sleep(1000)
Send("n")
Sleep(2000)
WinClose("Untitled - Paint")
EndFunc ;==>createnew