microsoft / WinAppDriver

Windows Application Driver
MIT License
3.66k stars 1.4k forks source link

Timeout for WinAppDriver in Java #1418

Open leticiafer opened 3 years ago

leticiafer commented 3 years ago

Is it possible to do a timeout for WinAppDriver with this instruction in Java? WindowsDriver<WindowsElement> session = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appCapabilities, TimeSpan.FromMinutes(10));

anunay1 commented 3 years ago

no. This instruction is for the commands, what is the timeout that you are looking for.

leticiafer commented 3 years ago

I need timeout with WinAppDriver, that is to say, I need a wait for WinAppDriver while app is starting. I know thread.sleep but I need time in part of server (WinAppDriver) not in App.

trashbat commented 3 years ago

You can wait up to 50 seconds for the app to start with the latest version of WinAppDriver (1.2.1). Something like this in Java:

appCapabilities.setCapability("ms:waitForAppLaunch", "50");