Hot answers tagged

6

My answer borrows from NarendraC's answers. @Test (priority=1) public void CreateNew() throws Exception { Process p = Runtime.getRuntime().exec("exeFiles\\CreateNew.exe"); p.waitFor(); } @Test (priority=2, dependsOnMethods={"CreateNew"}) public void OpenaFile() throws Exception { Runtime.getRuntime().exec("exeFiles\\OpenaFile....


5

Simpler solution is try a waitFor() on your process, this waits until the process exits. @Test (priority=1) public void CreateNew() throws Exception { Process process = Runtime.getRuntime().exec("exeFiles\\CreateNew.exe"); process.waitFor(); Integer result = process.exitValue(); Assert.AssertEquals(0, result) } Now you can add an ...


3

AutoIT, Sikuli or Kantu Automation all work fine in a virtual machine (e. g. Virtual Box). If you have a problem there, please provide details. On the other hand, these tools need a desktop - so they can not run headless. This is by design. They can not be compared with tools like PhantomJS that just emulate a web browser.


2

I assume that the remote machine is locked, and thus AutoIT can not work. It works on your desktop because it is not locked. Solution: Keep the desktop unlocked (no screensaver etc). Of course, this reduces the security as well. Possible other solution: Instead of AutoIT, use Kantu for the file uploads. Kantu works inside Chromium, and runs fine on locked ...


1

So i am returning custom status code from the autoIT script if the step passes : Here WinActivate returns zero if the step failed ( means the window is not present) #include <ScreenCapture.au3> Local $Status AutoItSetOption('MouseCoordMode',0) AutoItSetOption('GUICoordMode',0) AutoItSetOption('PixelCoordMode',0) $Status=WinActivate('<window1 ...


1

Depending on what you are testing (i.e. the actual process of using the upload control, or just the ability to upload / validate a file) you can skip the upload popup entirely. This also means you don't need autoit (which will mean you can run the tests on unattended (locked) machines. e.g. Generally any upload button will be something like the below when ...


1

I also faced the same problems using AutoIT and Sikuli both are not give stable solutions for me for my works. Now i'm using Robot class with selenium for upload file Click File Upload Button driver.findElement(By.xpath("//*[@id='photofile']")).click(); Copy file path of uploading file StringSelection ss = new StringSelection("E:\\Capture.PNG"); ...


1

Why do you want to integrate AutoIT into selenium? If it would be more correct to say why would you want to integrate Java with AutoIT? There are much simpler ways to do the stuff. Java definitely has its own ways to interact with win32api but that is not what it was intended to do. If you want to automate some native windows activities - use AutoIT. If you ...


1

What you are wanting to do is look for the exit code from AutoIT. You can set the exit code using the exit keyword. Typically, an exit code of 0 is success anything else is a failure or gives other information. By using different exit codes in your AutoIT script you can then check the code in your Java. Process process = Runtime.getRuntime().exec("...


1

Even why cant you try "dependsOnMethods", This will be useful in that sense. Check out below example for use: @Test (priority=2, dependsOnMethods={"CreateNew"})


Only top voted, non community-wiki answers of a minimum length are eligible