microsoft-ui-automation

Some controls on a page are not visible for MS UI Automation

拈花ヽ惹草 提交于 2019-12-10 16:37:18
问题 We have an application with StartPage.xaml, where control template for TabControl defines some grids and stack panels. There is an itemPresenter in that template in the middle of the xaml, and a stack panel below it. While it works fine for a user, MS UI automation can see only tab items inside the item presenter, and nothing else that is defined on the same level in the template. I tried to add standard button inside a stack panel which can not be seen by MS UIA to check if that is a problem

Adding UIAutomation Providers to Delphi controls (specifically grids)

拜拜、爱过 提交于 2019-12-08 17:35:25
问题 Our VCL Delphi application has a number of grids that we need to start to interact with via UIAutomation. There are a number of issues, not least that the TStringGrid doesn't implement any of the IUIAutomation patterns (IGridProvider or ITableProvider, or for that matter even IValueProvider). I am trying to find out what I need to added to a TStringGrid to allow it to implement the providers (which in the System.Windows.Automation.Provider namespace in .NET). 回答1: Although I cannot provide

CodedUI object creation based on UITestControl

半世苍凉 提交于 2019-12-08 06:37:56
问题 My question is a continuation on the following CodedUI not recognizing HtmlControl when searched within scope of UITestControl instead of BrowserWindow question. I'm experiencing the same problem and I would like to know why this is happening. Here are my findings. BrowserWindow inherits from ApplicationUnderTest, which on his own inherits on ApplicationBase, which again inherits from UITestControl. All the controls as HtmlRow do contain a constructor requesting as a parameter UITestControl.

How to click on a “pane” using UI automation library?

守給你的承諾、 提交于 2019-12-08 06:01:48
问题 We have an application in which I need to click on a Pane. I tried to use the following code, which I use to click on a button, but it gave Unsupported pattern exception. InvokePattern click_pattern = (InvokePattern)adjust_button.GetCurrentPattern(InvokePattern.Pattern); click_pattern.Invoke(); Is there any other way to do it? 回答1: Even though the object is clickable, depending on how the click is being handled internally, you may not necessarily be able to use the InvokePattern to perform a

Exposing custom properties using UI Automation Framework

北战南征 提交于 2019-12-08 03:26:12
问题 Given a very basic WinForms custom/user control, using System.Windows.Automation it is possible to manipulate built in properties for the custom control. This is done like this: public object GetPropertyValue(int propertyId) { if (propertyId == AutomationElementIdentifiers.NameProperty.Id) { return "Hello World!"; } } What I would like to do is expose custom properties to ui automation such as ReadyState, LastAccessed, Etc. Is this possible? 回答1: No, you can't extend the list of properties,

UI Automation not working for DataGridView

北慕城南 提交于 2019-12-07 13:46:44
问题 After trying out several solutions, I am in desperate need for help. I tried several approaches, before finally copying and still being stuck with the solution from Getting full contents of a Datagrid using UIAutomation. Let's talk code, please consider the comments: // Get Process ID for desired window handle uint processID = 0; GetWindowThreadProcessId(hwnd, out processID); var desktop = AutomationElement.RootElement; // Find AutomationElement for the App's window var bw = AutomationElement

CodedUI object creation based on UITestControl

不打扰是莪最后的温柔 提交于 2019-12-06 15:36:50
My question is a continuation on the following CodedUI not recognizing HtmlControl when searched within scope of UITestControl instead of BrowserWindow question. I'm experiencing the same problem and I would like to know why this is happening. Here are my findings. BrowserWindow inherits from ApplicationUnderTest, which on his own inherits on ApplicationBase, which again inherits from UITestControl. All the controls as HtmlRow do contain a constructor requesting as a parameter UITestControl. From the experience I can confirm that, no mater if you pass in an instance of at example HtmlDiv or

How to click on a “pane” using UI automation library?

浪尽此生 提交于 2019-12-06 14:39:55
We have an application in which I need to click on a Pane. I tried to use the following code, which I use to click on a button, but it gave Unsupported pattern exception. InvokePattern click_pattern = (InvokePattern)adjust_button.GetCurrentPattern(InvokePattern.Pattern); click_pattern.Invoke(); Is there any other way to do it? Even though the object is clickable, depending on how the click is being handled internally, you may not necessarily be able to use the InvokePattern to perform a click. That appears to be the case here. As an alternative, you can use some code to move the mouse cursor

How to manipulate a control without any pattern implemented?

天涯浪子 提交于 2019-12-06 08:28:44
I'm trying to implement the automation test via UIAutomation for our project. But lots of the controls are not standrad, and proper patterns are also not implemented for that controls. How should I to manipulate the controls via UIAutomation framework in this case? For example, a button in our product is implemented via a Pane, and the invoked pattern is not implemented as well. How should I click the button? (To avoid installing VS on the test machine, I don't want to use Mouse.Click() in Microsoft.VisiualStudio.TestTools.UITesting namespace) Is there a way to do that only using UIAutomation

Can I get a bitmap of an arbitrary window in another application process?

旧街凉风 提交于 2019-12-06 06:03:47
I am trying to automate a third-party Win32 application where I want to capture the graphics content of a particular window at defined time intervals. I am in the early phases of this, and I'm currently trying to use the Microsoft UI Automation API via C# to do most of the interaction between my client app and the external app. I can now get the external app to do what I want it to do, but now I want to capture the graphics from a specific window that seems to be some third-party owner-drawn control. How can I do this? The window I want to capture is the one marked by the red rectangle in this