Comments (35)
At this time, we don't have any plan to support. Close it for now. Can reopen if this is changed.
from windows-containers.
Folks, after some internal investigation I'm getting the conclusion that we don't have a better answer at this point on UI automation, other than the APIs we provide on the Windows image. Since this seems to be a hot topic, I wanted to comment here and let you know that this is something we're taking in consideration as we evaluate new capabilities for Windows containers. Thanks for your input so far.
We'll close this issue for now, but please rest assured the inputs from this thread will feed our investments on upcoming releases.
from windows-containers.
Still waiting....
from windows-containers.
Microsoft team, please provide an update.
from windows-containers.
@weijuans-msft, with all the respect it's not completed, it is failed.
from windows-containers.
Ok, than it might be documentation. I was looking for this for some time, but only found stuff like this though:
- Sorry no. Microsoft specifically isn't supporting RDP or GUI's in containers, as far as I know. (...) but if you're trying to develop a desktop app, then containers aren't ideal.
- Microsoft made a change sometime after microsoft/windowsservercore:1709_KB4074588, breaking RDS.
- Iβm looking forward to Windows apps being available with GUI; I think itβll be really useful in my job.
- UI testing is explicitly mentioned in the post, however I (and according to the reactions on that post some other people as well) are unable to actually interact with the app through WinAppDriver or other UI automation tools. (...) and also that there is no mouse support
And this could also be related:
from windows-containers.
Hey everyone, the Windows containers product team is still monitoring this issue. I am reopening the issue to keep for tracking the feature request, but there are no new updates to provide--it is still sitting on our backlog. If/when we do have an update, we will post it here or you can monitor the Windows container blog.
from windows-containers.
This issue has been open for 30 days with no updates.
@vrapolinario, please provide an update or close this issue.
from windows-containers.
Can you offer an explanation as to why this use case is not supported? Its literally one of the most useful features of containers. UI testing is a giant chore using VMs. Clearly all the code to make it work already exists (e.g. windows sandbox) and this is a totally artificial software imposed limit.
from windows-containers.
@vrapolinario There appears to be negative progress on the Windows image that had a larger set of APIs available. From reading here, things that used to work in 1809 containers (like getting the main window title) no longer work in 1909 containers.
What we could really use is containers based on Windows Sandbox. But Microsoft puts artificial restrictions on that (along with the artificial licensing restrictions on normal Windows sessions) that makes it very very difficult to perform Windows Desktop UI automated testing.
from windows-containers.
Adding @weijuans-msft for visibility.
Can't speak for the Sandbox option. We do want to address this scenario and we're looking into it, but no timeline at this point.
We'll update this issue once we have more to share.
from windows-containers.
@vrapolinario re large set of APIs, is it now possible to take a screenshot of a running app in a Windows Container? If not, when will it be available?
from windows-containers.
Thanks for opening this issue @agowa338.
Have you checked the Windows base container image? (Not Server Core or Nano Server)
This image does provide support for UI automation - the downside comes with the size of the image, but the scenario should work.
from windows-containers.
This issue has been open for 30 days with no updates.
@vrapolinario, please provide an update or close this issue.
from windows-containers.
This issue has been open for 30 days with no updates.
@vrapolinario, please provide an update or close this issue.
from windows-containers.
This issue has been open for 30 days with no updates.
@vrapolinario, please provide an update or close this issue.
from windows-containers.
Same. We need official way for UI automation.
From the replies this got I think some clarification is needed. I also think I now understand what @vrapolinario meant with there already being an official way. There is: https://docs.microsoft.com/en-us/dotnet/framework/ui-automation
However the API is quite "limited" in some while being quite capable in other situations.
That API is not able to fake input to notepad without the window being onscreen and having focus.
This is because notepad requires "System.Windows.Automation.TextPattern" to be used instead of "System.Windows.Automation.ValuePattern" and that one does not offer a set text method (more about why that matters in the example at https://docs.microsoft.com/de-de/dotnet/framework/ui-automation/add-content-to-a-text-box-using-ui-automation).
Therefore the only way to write into notepad automatically is using "System.Windows.Forms.SendKeys.SendWait". But if the focus suddenly changes, e.g. a popup opens, an error message is thrown, ... the input is provided to the wrong application...
Because of that, this is not a stable way to automate gui applications.
But there are also advantages of the current API. For example compared to AutoIt it allows to access elements within an WPF element within an dotnet application. And it doesn't require an additional runtime, powershell/dotnet is enough
Tl;Dr: The current state is better than I initially was aware of, but it still needs some polishing.
Example code for automating notepad:
[void][System.Reflection.Assembly]::LoadWithPartialName("UIAutomationClient")
[void][System.Reflection.Assembly]::LoadWithPartialName("UIAutomationTypes")
[void][System.Reflection.Assembly]::LoadWithPartialName("UIAutomationProvider")
[void][System.Reflection.Assembly]::LoadWithPartialName("UIAutomationClientsideProviders")
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
# According to the documentation this should be also called, but within powershell 7.1 it fails
# and within Windows Powershell (5.1) it is unstable and always throws an exception the first time it is called and succeeds the 2nd time...
# Also it doesn't seam to be needed for "just" automating notepad.
#$client = [System.Reflection.Assembly]::LoadWithPartialName("UIAutomationClientsideProviders")
#[Windows.Automation.ClientSettings]::RegisterClientSideProviderAssembly($client.GetName())
$autProc = Start-Process notepad -PassThru
$rootElement = [Windows.Automation.AutomationElement]::RootElement
$condAUTProc = [Windows.Automation.PropertyCondition]::new([Windows.Automation.AutomationElement]::ProcessIdProperty, $autProc.Id)
$autElement = $rootElement.FindFirst([Windows.Automation.TreeScope]::Children, $condAUTProc)
# LocalizedControlTypeProperty is derived using "Accessibility Insights for Windows"
$documentElement = [Windows.Automation.PropertyCondition]::new([Windows.Automation.AutomationElement]::LocalizedControlTypeProperty, "document")
$document = $autElement.FindFirst([Windows.Automation.TreeScope]::Descendants, $documentElement)
$document.SetFocus()
[System.Windows.Forms.SendKeys]::SendWait("FooBar")
from windows-containers.
Thanks @agowa338 for the follow up. Can I recommend you provide the feedback directly to the documentation above. It might be the case that the team who owns it has not seen feedback on it for Windows Containers.
@slavanap apologies for the delay. Does this helps with your case as well?
from windows-containers.
Does
https://github.com/microsoft/WinAppDriver
work in containers? Because if not then the suggested approach requires manual walkthrough and tinkering of every step, and doesn't support steps recording.
from windows-containers.
There's an issue on that repo: microsoft/WinAppDriver#1046 covering exactly that. While that tool appears not to work on Windows Containers as it depends on an active desktop session, there are alternatives in there.
I went ahead and opened an issue on their repo to add support for Windows Containers. Please remember this is a different team and we don't own their prioritization. We'll definitely work together if needed, though.
from windows-containers.
The general issue with UI automation is that
- app installation,
- app startup sequence,
- app shutdown sequence
do involve iteration with GUI, although these legacy apps run as a backend service, they require interactions with GUI to get launched.
Also, for such apps state monitoring like an ability to take a screenshot would be really useful.
from windows-containers.
UI automation appears to not work at all when I try using windows:1909 and TestStack.White.
After opening notepad.exe and using the underlying System.Windows.Automation, I don't see any children under the root element (Desktop). IE, the following prints nothing:
using System.Windows.Automation;
...
var lWalker = new TreeWalker( Condition.TrueCondition );
var lElement = lWalker.GetFirstChild( AutomationElement.RootElement );
while ( lElement != null )
{
Console.Out.WriteLine( $"{lElement.GetType().Name} {lElement.Current.Name} {lElement.Current.ProcessId} {lElement.Current.BoundingRectangle}" );
lElement = lWalker.GetNextSibling( lElement );
}
from windows-containers.
The Get-Process Notepad | ? MainWindowTitle -ne "" | Select MainWindowTitle
Powershell command mentioned as working with windows:1809 in another thread no longer works with windows:1909.
What we could really use is a way to run multiple copies of Windows Sandbox as part of our CI. Why can't we use that as a Docker base? That also doesn't require a 6GB download/17GB image.
from windows-containers.
Thanks @agowa338 for the follow up. Can I recommend you provide the feedback directly to the documentation above. It might be the case that the team who owns it has not seen feedback on it for Windows Containers.
The team apparently doesn't accept feedback. There isn't "provide feedback" at the bottom of the page as other docs pages have...
from windows-containers.
Than can I recommend you provide the feedback directly at their repo? Here's the URL: https://github.com/microsoft/dotnet.
from windows-containers.
This issue has been open for 30 days with no updates.
@vrapolinario, please provide an update or close this issue.
from windows-containers.
Is it right that UI automation of legacy apps for Windows Containers infrastructure is not a priority for dev team right now?
from windows-containers.
We made some progress on this with the Windows image that has a larger set of APIs available. Other than that, it seems the request is for tools that perform automation of UI tests need to support its own deployment on Windows containers. This unfortunately is out of our scope on the platform.
from windows-containers.
I'm not aware of a PowerShell option (or cmd for that matter) to take a screenshot, so I'm assuming it's not possible.
from windows-containers.
Thanks for this. Please let us know if there is any roadmap
from windows-containers.
With the release of this new image, are there any changes with respect to this topic?
from windows-containers.
update?
from windows-containers.
Hi @vrapolinario, any update on this? it's been 6+ months since you were last active in this thread.
from windows-containers.
This issue has been open for 90 days with no updates.
@weijuans-msft, please provide an update or close this issue.
from windows-containers.
Up
from windows-containers.
Related Issues (20)
- L2Bridge not working correctly on Windows server 2022 - 21H2 HOT 10
- Support Window 10 base image for Windows Service 2022 HOT 1
- Not able to download windows container images HOT 3
- WIN API LoadLibraryA is failling when loading a DLL created by Intel Fortran compiler in Windows Nanoserver container HOT 6
- Loading Minifilters in HyperV containers HOT 3
- Docker in Docker with Windows Containers HOT 2
- pull image from PS command on Docker Desktop Window 10Ent HOT 13
- Plans for Windows 10/11 Containers in the Future HOT 4
- Issues Installing Oracle Instant Client on Windows Container: Network Sharing Problem HOT 2
- `ERROR_ACCESS_DENIED` when trying to open for writing _hidden_ files located in mounted folder inside containers HOT 8
- How to deploy dotnet microservice in iis server inside Docker container HOT 4
- Get-WindowsFeature is not available in mcr.microsoft.com/windows:ltsc2019 HOT 7
- Process Isolation is very slow as compared to HyperV Containers on Server 2019 HOT 5
- regsvr32 fails when registering DAO350.DLL HOT 3
- install-docker scripts failing when passing -useDHCP due to deprecated dependency HOT 4
- MSIX installation support HOT 4
- [MicrosoftDocs] Insufficient Documentation for Windows Server 2022 HOT 3
- [MicrosoftDocs] gMSA Documentation HOT 5
- Issue with missing DLL in runtime:4.8-windowsservercore-ltsc2022 HOT 5
- Windows containers shutdown not working properly on docker (no SIGTERM?) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from windows-containers.