WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Minimize WinAppDriver.exe programmatically

Open Urvika-gola opened this issue 2 years ago • 6 comments

is there any argument that can be passed to WinAppDriver.exe while launching such that it opens it in a minimized way?

Note, that I tried this on command prompt and it works fine start "" /min "C:\Program Files\Windows Application Driver\WinAppDriver.exe" but, I am using psexec, and the same command, when used with psexec, doesn't work. PsExec.exe -nobanner -accepteula -i 1 \\localhost -u username -p password "start \"\" /min \"C:\Program Files\Windows Application Driver\WinAppDriver.exe\""

PsExec could not start start "" /min "C:\Program Files\Windows Application Driver\WinAppDriver.exe" on localhost:
The filename, directory name, or volume label syntax is incorrect. 

So, it would have been altogether easier if there is any argument that WinAppDriver can take while launching it from the command prompt. It will be really helpful, considering WinAppDriver is used for automation (hence programmatically), and since it's related to UI, it would be helpful to open it in a minimized state so that it doesn't hinder UI elements on the screen.

How do you all approach this problem?

Urvika-gola avatar Apr 01 '22 13:04 Urvika-gola

you can use the key combination windowskey+d, it will minimize all the windows, but what is the issue it's causing?

anunay1 avatar Apr 03 '22 16:04 anunay1

That can be done, but I am looking to launch it in minimized mode. Win+d will minimize everything on the screen, I want to avoid this.

Urvika-gola avatar Apr 21 '22 05:04 Urvika-gola

Which language binding are you using?

anunay1 avatar Apr 21 '22 05:04 anunay1

Python.

Urvika-gola avatar Apr 21 '22 05:04 Urvika-gola

Is its C# then using system.process you can launch WAD in minimize mode

anunay1 avatar Apr 21 '22 05:04 anunay1

try this

import subprocess

def startProgram():
    SW_MINIMIZE = 6
    info = subprocess.STARTUPINFO()
    info.dwFlags = subprocess.STARTF_USESHOWWINDOW
    info.wShowWindow = SW_MINIMIZE
    subprocess.Popen(r'C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe', startupinfo=info)

startProgram()

anunay1 avatar Apr 21 '22 05:04 anunay1