Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all 585 articles
Browse latest View live

Does UI Automation for WPF support Toggle Button?

$
0
0

Does UI Automation for a WPF application support the Toggle Button? The Toggle Button is not listed in the list of supported controls (see here):

https://msdn.microsoft.com/en-us/library/ms743581(v=vs.110).aspx

Thank you!


Is ToggleButton supported in the Microsoft UI Automation?

$
0
0

I need to automate a WPF application that has a Toggle Button.

The following articles contain information about support for control types and their associated control patterns in Microsoft UI Automation:

https://msdn.microsoft.com/en-us/library/ms743581(v=vs.110).aspx

https://msdn.microsoft.com/en-us/library/ms750574(v=vs.110).aspx

The Toggle Button does not appear in the lists of supported controls. Does it means that the ToggleButton control is not supported in the Microsoft UI Automation?

Shim AutomationElementInformation - MS Fakes

$
0
0

Hello,

I would like to shim AutomationElement.AutomationElementInformation using MS Fakes for some tests on our code that uses MS UIA.  When the Fakes are generated however, ShimAutomationElementInformation is generated as a sealed class with none of the members the actual Struct has.

Shimming AutomationElementInformation would be very helpful as the AutomationElement.Current property contains a lot of info I use at runtime.  Is this possible to shim using Fakes or am I missing something?

I'm using VS 2015 ultimate.

Thanks.

Finding Windows on the Desktop

$
0
0

Hi all,

in the context of coded UI testing, I am trying to enumerate windows that have the desktop as their parent. I wrote the following code (this is the constructor of the UILoginWindow2 class which is derived from WinWindow):

public UILoginWindow2()
{
    Trace.WriteLine(string.Format("Desktop HWND={0:X8}", (int)Desktop.WindowHandle));

    UITestControlCollection desktopChildren = Desktop.GetChildren();

    foreach (UITestControl desktopChild in desktopChildren)
    {
        Trace.WriteLine(string.Format("Desktop child HWND={0:X8}", (int)desktopChild.WindowHandle));
    }
}

Now I wonder why this creates the following output:

A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
Desktop HWND=00010010
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.dll
A first chance exception of type 'System.NotImplementedException' occurred in Microsoft.VisualStudio.TestTools.UITest.Extension.dll
Desktop child HWND=00010010
Desktop child HWND=00010010
Desktop child HWND=00010010
Desktop child HWND=00010010
Desktop child HWND=00010010

Can anyone explain what I'm doing wrong? (I know that this code snippet does not contain useful code but I see no use in writing "real" code before the basics work...)

(Edit: The above output seems to indicate that all desktop children have the same HWND as the desktop itself, which cannot be correct. Either the code does not do what I want it to, or my interpretation of the output is wrong.)

Thanks

Hans



WPF manipulate properties of another window

$
0
0

Hey

I'd need some help with getting and manipulating elements in WPF applications form.
So far I've had success doing so using WPF Inspector, and so I downloaded the source code of it, however it seems that its either incomplete or just reformatted so that running project form VS does not compile the same exe as it is installed. This results in source project not working at all beyond the point of detecting WPF applications currently running, so I can't help much by it.

Basically what I need to achieve is hook/attach to the running application's window, get some objects/buttons, and manipulate it's properties (isPressed, isEnabled) programmatically.

I made a simple UDP socked in a new project to get messages from my Android app, but I have no idea (and no experiences) how to control WPF components/objects.

As a side note I should add, I've only been working with C# for the last few weeks so I'm total novice,  I do have long term experience with Flash and AS3 though, so I should get the syntaxes pretty fast.


Would anyone be so kind to help me out, point me to the right direction or maybe provide a simple sample on how to achieve something at least similar to what I need?

Thank you.



Cheers,
Glenn

Child element won't be enumerated by RawTreeWalker but can be found by Element.FromCursor

$
0
0

When I access my application and I enumerate the controls by walking the tree using the RawTreeWalker there is an element that is not being enumerated. It's a popup element that comes from another drop down element. It ends up not being a child of the drop down but rather a child of the form containing the drop down. My monitoring application is able to find the element via CUIAutomationClass.ElementFromPoint and it can also properly build its parent hierarchy using IUIAutomationElement.GetCurrentParent recursively.

However if I click the popup and display it's content then enumerate from the base form using the RawTreeWalker the element is not found. I'd love for someone to point me to what I'm doing wrong. Here is my tree walker code.

private static IEnumerable<IUIAutomationElement> GetChildren(Element element)
{
	var automation = new CUIAutomation8Class();
	var walker = automation.CreateTreeWalker(automation.RawViewCondition);
	var child = walker.GetFirstChildElement(element.NativeElement);

	while (child != null)
	{
		yield return child;
		child = walker.GetNextSiblingElement(child);
	}
}


Facing issues with JAWS screen reader for WPF application

$
0
0

Hi,

I'm developing a WPF based windows application. I need it to support the screen reader JAWS.

I have 2 queries.

1) On pressing Insert + PageDown, Jaws is expected to read out the last element in the window (in my case the status bar), but it reads out only the title bar. (I'm using AutomationProperties.Name on every possible elements.)

2) On pressing Insert + B, Jaws is expected to read out the full content of the window. In my case, its just reading the title bar, and not the content of the window.

Is there something that I'm missing?


Alen Alex


Not able to call DISM functions from WMI provider

$
0
0

I needed to enable disable(on/off) windows features from my C# WMI provider Dll.
I tried using the native functions from DismApi.dll. (I use DllImport ).The functions wanted to use are DismInitialize, DismOpenSession, DismEnableFeature, DismDisableFeature and DismCloseSession.

When I call DismInitialize from WMI provider Dll I am getting HR result as 0x800702e4 (The requested operation requires elevation).
I am calling the coupled WMI provider with the help of PowerShell scripts. The PowerShell ISE is running as Administrator.

Also just for tests I tried using Dism APIs from console application instead of WMI provider. If I call same DISM APIs from console application I am not getting 0x800702e4 error.

Any suggestions to get over this issue ?


How to get the “PreferredWidth” of label control using the UIAutomation(Automationelement)?

$
0
0
Note: ControlType.Text has no supported patterns

I have tried with following steps to get "PreferredWidth" and it is not supporting

Step1:- 

        private GetLabelPreferredWidth()
        {
            AutomationElement objElement = objMainWindow.AutomationElement;           
            PropertyC
ondition cond = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text);
            AutomationElement textProvider = objElement.FindFirst(TreeScope.Descendants, cond);

        }

        Note:
        I need to get the “PreferredWidth” from the “textProvider”. But it is not available

aria-label not being read in IE 11 or less using JAWS 17 in Select

$
0
0

I have this matching game and the key is to the right and the questions are to the left on the page. To add additional usability I want the screen reader to be able to read additional information that the visual user cannot see. The code works in Firefox, Chrome and Edge but not in IE 11 or less. Does anyone know a work around that would work? Placing the text off screen does not work.

Here is the code:

<select><optionid="question1_item0">Select</option><optionid="question1_item1"aria-label="1 an actor">1</option><optionid="question1_item2"aria-label="2 a country">2</option><optionid="question1_item3"aria-label="3 a color">3</option><optionid="question1_item4"aria-label="4 a web site">4</option></select>

GetCachedChildren not working

$
0
0
I am new to UIA and i am having some problem in properly caching my elements. The thing is my GetCachedChildren function always returns a NULL for my children array. And the reason behind it is i think me. Because i am having a hard time understanding which of the elements get cached or how to properly cache them.

IUIAutomationCacheRequest* CacheRequest = NULL;
        hr = Auto->CreateCacheRequest(&CacheRequest);
        if (SUCCEEDED(hr))
        {
            hr = CacheRequest->AddProperty(UIA_BoundingRectanglePropertyId);
            if (SUCCEEDED(hr))
            {
                hr = CacheRequest->AddProperty(UIA_NamePropertyId);
                if (SUCCEEDED(hr))
                {
                    hr = CacheRequest->AddProperty(UIA_LocalizedControlTypePropertyId);
                    if (SUCCEEDED(hr))
                    {
                        hr = CacheRequest->AddPattern(UIA_ButtonControlTypeId);
                    }
                }
            }
        }

        IUIAutomationCondition* ButtonCon = NULL;
        IUIAutomationElementArray* ButtonArray = NULL;
        IUIAutomationElement* Button = NULL;
        VARIANT var;
        var.vt = VT_I4;
        var.lVal = UIA_ButtonControlTypeId;
        Auto->CreatePropertyCondition(UIA_ControlTypePropertyId, var, &ButtonCon);
        if (ButtonCon == NULL)
        {
            return;
        }

        Parent->FindAllBuildCache(TreeScope_Children, ButtonCon, CacheRequest, &ButtonArray);

In the next iteration when i call
Parent->GetCachedChildren(&Element);
 It doesnt work.


Now i am not sure how to retrieve these cached elements? whenever i try to get elements via getcachedchildren the array is always empty? Can someone at least give me an idea (theoretically) as to how to properly cache the elements? Because i am finding it really hard to understand what the sequence of my actions will be in order to peroperly cache and retrieve the elements and their properties.

Script to resize the task bar

$
0
0

I need a script to resize the task bar o shortcut key combination to launch that script and resize the task bar

Usually I have four bar height and sometimes I only need the standard height one

Under windows 8

Best Regards

Map CapsLock To Ctrl+Shift

$
0
0

hello, there's a way to map one key to another via Regedit -> Scancode Map

but I want to map 2 buttons (ctrl+shift) to use capslock as a keyboard layout switch

I know that I can bind or disable many buttons with one string, but what happens if those 2 buttons will be assigned to 1?

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]

Scancode Map

00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00

+
00,00,00,00,00,00,00,00,02,00,00,00,2a,00,3a,00,00,00,00,00
=
00,00,00,00,00,00,00,00,03,00,00,00,2a,00,3a,00,1d,00,3a,00,00,00,00,00 

or maybe

00,00,00,00,00,00,00,00,04,00,00,00,2a,00,3a,00,1d,00,3a,00,00,00,00,00

??
is it correct string?

"Open" button in File -> Open dialog box has identity issues

$
0
0
It doesn't know whether it wants to be a Button control type or a Pane control type (this is in Vista, by the way).

If I open UISpy, then open an Open File dialog, the "open" button is reported to be a Pane.
If I open an Open File dialog, then open UISpy, the "open" button is reported to be a Button.

It gets weirder.

If I let my program, which uses UIAutomation, find all the buttons in the open file dialog it reports the "open" button to be a Pane.
If I halt my program and step through in the debugger, it takes exactly the same path through the code, but reports the "open" button to be a button.

I'm pretty stuck on this - has anyone had a similar experience?

Various WinForms / Win32 controls in Win10 only visible as "Pane"

$
0
0

Hello

I'm working on a new C# UI Automation Library which is based on the native 3.0 library.

While working on that, I found that a WinForm application shows pretty much all controls only as Pane (Bereich in the following screenshot):

If I remove the "Prefer 32-Bit" Flag from the project settings, it looks correct. See this screenshot:

As you can see in those two screenshots, in the first one, the checkbox is only a pane and the combobox is only a pane with a nested pane. Why is this happening? What has the "Prefer 32-Bit" Flag to do with that?

This happens when I run the application on Windows 10, compiled with VS2013 or 2015. It does not happen when I run the application in pre Windows 10.

As a side note: A friend tried to reproduce the issue on his pc. He could not (also Win 10 and VS2015). He has the Win10 SDK installed and I haven't. Were there any changes in UIA which are installed with the Win 10 SKD? Another thesis could be that this only happens on a German system? Can anyone confirm this?

Thanks for your advice!

Roman





WinForms CheckBox on Win 10 does not fire PropertyChangedEvent for TogglePattern.ToggleStateProperty

$
0
0

As the title says, when having a WinForms checkbox and have registered the propertychanged event on it's togglestate property, the event never fires (works with WPF).

This can easily be reproduced with any WinForms app and UIAVerify (Toggle Tests fail).

Are there any workarounds for this problem or is this going to be fixed?

Thanks

Roman

Getting the entire screen region of a page in print preview in Microsoft Word

$
0
0

I'm trying to identify the entire page view in print area. Using the UIAutomation framework, I can drill down when in Print Preview mode like so:

  1. Word window (ClassName = OpusApp)
  2. Pane (ClassName = _WwF)
  3. Pane (ClassName = _WwB)
  4. Document (ClassName = _WwG)
  5. Page (custom control with AutomationID = UIA_AutomationID_Word_Page_#)

Object #4 represents an area the entire width of the application (excluding scrollbars) the includes the page as well as an area of gray space (the red box)

Object #5 represents just the content on the page, excluding the margins. (the green box)

Is there a way to grab the object representing the actual page with the margins (the blue box)?

VisualUIAVerifyNative.exe launch through error.

$
0
0

Hi Guys,

      I came acrross an issue were when ever I launch VisualUIAVerifyNative.exe tool I always gets an error of "Binary strean '0' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization". I downloaded the latest SDK still getting same error. not sure what went wrong, earlier it work well. 

   

[UIAutomaiton] UIA returns wrong coordinate for all icons on traditional desktop if DPI scaling level > 100% (windows 10)

$
0
0

Hi :

I used UIA framework (.Net framework verison is 4.5) to click icon on the traditional desktop on windows 10, but I found

if DPI scaling level > 100%, UIA will return wrong coordinate (it has bias value) for all icons on desktop ( only happened for desktop)

Does anyone know how to solve this problem? or give any suggestion??

:)

the drive redirection question of Windows 10

$
0
0

Hi all,

    we redirect the usb stick to win10. and it is ok. we can download a file to usb stick,

   but File explorer cannot show the icon of usb stick properly.

we redirect two sub sticks, but the file explorer only show one of them. (there are two sub stick icons at left side, but there is one usb stick icon at right side.)

        if we click Refresh, it will show two usb stick icons.

after we unplug the usb sticks, the File explorer has removed the icons of usb stick at left side, but there are strange icons at right side.

is there any idea about this phenomenon?

Thanks,

Derek

Viewing all 585 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>