I want Selenium to wait untill and unless Autoit Script is completed.
Right Now whats happening is When I run TestNG.xml
file it runs all the @Test Priority wise and within 5 sec TestNg output Console Shows all the @Test are Passed.
While my AutoIT scripts are still running parallely in 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");
}
And the Code of AutoIt file 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