WinAppdriver tests failures from locked Windows 10 machine
I'm running UI tests on a UWP app where the tests fail with the following exception when the win 10 machine is locked. But tests are running successful otherwise.
I need help understanding what the exception mean
org.openqa.selenium.WebDriverException: Unable to find the given UIObject. Search criteria:'ClassName = Windows.UI.Core.CoreWindow' Search domain:'A collection of MS.Internal.Mita.Foundation.UIObject instances in the set defined as Children of '{My Application, ApplicationFrameWindow, 42.1443280}' ('[Unknown UICondition]') matching: Condition: 'True'..' (WARNING: The server did not provide any stacktrace information)
Source code :
String windowHandle = desktopSession.findElementByName("MyApplication").getAttribute("NativeWindowHandle");
Util.waitFor(5000); DesiredCapabilities viewCaps = new DesiredCapabilities(); viewCaps.setCapability("appTopLevelWindow", toHex(windowHandle));
try { /** exception thrown here **/ viewSession = new WindowsDriver
(new URL("myappiumurl"), viewCaps); } catch (MalformedURLException e) { log.error("Exception occured on attaching View session", e); }
Hi @sabarishnarain,
WinAppDriver doesn't support automation once lockscreen has been initiated as the WAD session gets cut. Can you explain the scenario a bit further (e.g. what initiates the lockscreen)?
Thanks
the device eventually locks up after being idle. I couldn't get our IT team disable lock screen as it appears to be violation of corporate security. I tried ps scripts to login before the tests kicks in, but was out of luck.
I created this issue to understand the root cause. Closing thread.
This should not be closed. This is a real issue as most corporate environments require the same thing. I just realized the same issue. When I'm RDP'd into the test machine it works, when I'm disconnected (locked) the tests fail.
I think the owners has to acknowledge this if this case needs to be reopened. @hassanuz ?
@hassanuz Hi So you mean that its not possible to run the tests on Teamcity server? night schedule for exempel?
Thanks
+1 Being able to use WinAppDriver on a locked machine is a necessary use case for running automated tests that may be triggered at any time
@orilevari The workaround I used is to override security policy with approvals from IT team and turned off auto screen lock. The device is now unlocked forever and will not be a privacy issue since its considered as build machine.
@hassanuz Since many folks are interested in this, can you guys confirm if this can be taken as a feature request ?
I would like also to run my tests on my machine when Im at lunch for example but it seems impossible due to WAD session gets cut, I think its a really big issue if there is no support for that!
Did anyone get around this issue?
@Saif4 I did on surface device. See comment above. But this not possible with VMs in the cloud.
Thansk @sabarishnarain But does anyone know if there is any support for that coming any time soon?
I am also in need for UI automation running even if the PC is locked. Please let me know if any workaround or solution available to achieve it. Thanks.
This will be a good to have feature for me too. Anyhow we had the same limitation in Coded UI so as a workaround we created a simple VB Script to keep windows from locking. But to be able to run all tests when machine is locked is really helpful.
There is no way around bypassing the lock screen. It is recommended to disable the lock screen entirely and set your machine up as an interactive agent to run continuously run UI tests.
Hello, Sorry to ask the question even if the discussion is closed. Has anyone by any chance found a solution to this problem. For my part, I work on Java (Test automation) and Jenkins (continuous integration). Thank you in advance for your answers.