microsoft / WinAppDriver

Windows Application Driver
MIT License
3.7k stars 1.41k forks source link

WinAppDriver and Docker Windows #1046

Open RobertJarlvik opened 4 years ago

RobertJarlvik commented 4 years ago

Has anyone been able to use Docker Windows with WinAppDriver? And is there more information about anyone succeeded with it? I have tried but unfortunately failed.

Best regards Robert J

anunay1 commented 4 years ago

Can you please share what all have you tried, even I want to try the same.

anunay1 commented 4 years ago

@hassanuz can you add some points to it.

dquist commented 4 years ago

There's no way to do headless UI testing for Windows application, so this is not possible. An active desktop session needs to active for Windows UI tests to work.

rob83ert commented 4 years ago

There's no way to do headless UI testing for Windows application, so this is not possible. An active desktop session needs to active for Windows UI tests to work.

Seems that way. Many people use RDP, as my self, and set the connection to actice through a command or registry. Sadly this is not implemented yet.

I hope there will be a solution for it. The solution I work with now in the company I work at is that we create just several VM's and connect to Azure DevOps with agents to run the GUI test with WinAppDriver which works fine. But it would be a more nice of a solution to scale up and down with in need with containers as we do with GUI testing with containers when GUI testing webb applications.

nickrandolph commented 4 years ago

@dquist are you saying that docker running a windows container in interactive mode wouldn't be able to launch a Windows app? tbh the whole process gets blocked well before that as even trying to install dependency appx seems to fail - would love to know if anyone's had any luck installing an appx or msix based application.

dquist commented 4 years ago

are you saying that docker running a windows container in interactive mode wouldn't be able to launch a Windows app?

Correct. Interactive mode is not enough, you need to have an active desktop session. For example, a remote desktop session. Painful, but that's just the way it is.

There are scripts you can use to detach your remote desktop session while keeping the desktop active on the remote, that's the best solution I've come up with.

nickrandolph commented 4 years ago

This post led me to think that it might be possible - https://www.pdq.com/blog/ui-testing-a-wpf-app-in-windows-containers/ I'm guessing whilst it would appear that it's running the app, they still don't have an active desktop session, so wouldn't be able to interact with the app. You would you have thought that it would be possible to at least run console uwp apps but this brings me back to the issue where I can't even get appx/msix to install.

dquist commented 4 years ago

Interesting, I had not come across that article before. Keep in mind he's using another tool, STUPS, instead of WinAppDriver.

nickrandolph commented 4 years ago

yep of course but I would imagine if we can get a windows app to install and run in a container, it would open the door to using which ever test tool you'd prefer to use.