Before starting test execution, I have to manually start this WinAppDriver.exe.
I want to automate this task when I start executing my test cases it should start this exe and after finish it will close it.
I have tried in Java with below code but I'm not success:
Runtime runTime = Runtime.getRuntime();
String executablePath = "C:\\Program Files (x86)\\Windows Application Driver\\WinAppDriver.exe";
Process process = runTime.exec(executablePath);
Note: I required to run it with 'Run As Administrator'
I would suggest using ProcessBuilder class from java as is it recommended to use it after Java 5 for starting/creating processes. Below code will start the WinAppDriver.exe :
String command = "C:\Users\Administrator\WinAppDriver\WinAppDriverTool\WinAppDriver.exe";
ProcessBuilder builder = new ProcessBuilder(command).inheritIO();
startWinAppDriver = builder.start();
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With