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

UI Automation - Memory Leak

$
0
0

I have encountered (what seems to be) memory leaks with the UI Automation Library. To track down the issue, I've stripped down my project to the bare minimum, and I am still able to reproduce the problem.

Originally, there were registered handlers for Structure, Property, Automation and Focus Change Events. But to be sure, I currently am monitoring only FocusChanged Events. Usage started at 41MB working set, 9MB private; and strictly climbs up from there. Adding Automation events only increases the rate at which it grows.

using System;
using System.Windows.Forms;
using System.Windows.Automation;

namespace focus_monitor_test
{
    static class Program
    {
        static void Main()
        {
            UIAListener listener = new UIAListener();
            System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            listener.Close();
        }
    }

    public class UIAListener
    {
        public UIAListener()
        {
            Automation.AddAutomationFocusChangedEventHandler(new AutomationFocusChangedEventHandler(OnUIAutomationFocusEvent));
        }


        public void Close()
        {
            Automation.RemoveAllEventHandlers();
        }

        public void OnUIAutomationFocusEvent(object src, AutomationFocusChangedEventArgs e)
        { }

    }

}

I know the problem is not in my code; I ignore all of the events anyway. I have read that events can be stored for 3 minutes until a timer expires. I manually collected garbage, but that does not make a difference.  Thoughts??


Problem Steps Recorder misses some steps

$
0
0

I have been using the PSR tool (Problem Steps Recorder) for some time and came across a problem having certain steps not being recorded (or added). The application I record is a WinForm executable, having both standard controls (.NET Controls) but also some custom written ones. The problem seems to be with the custom controls, like a custom drawn pushbutton, that is not being recorded and added to the list of steps. The"UI grabber" seems to register the click I make on the button but it will never add its screenshot/comment to the list. Therefore, I believe there must be some kind of API my custom Control do not implement and/or that the current implementation is somehow incorrect, excluding the proper event from being fired or handled properly.

 

Can anyone give me a hint on where I can find a solution for this? Is there are guide on what to think of when programming a custom Control, being "recordable" as all other controls?

Thanks in advance

/Stixy

TopMost works in Windows 8 but not Windows 8.1?

$
0
0

Hi,

I'm writing an application, that needs to layer it's UI on top of all other windows when active, including the Metro Start screen.

I'm using TopMost=true, and I modified the manifest to request UIaccess. I also signed the application, and put it in a trusted location...

The problem, is that this works 100% of the time under Windows 8. However, under Windows 8.1 it seems to mostly not work. It seems to randomly work a few times, then mostly not work. By not work, I mean that it only puts the UI on top of other windows while in desktop mode. When I switch to Metro, the windows disappear.

But like I said, it works 100% under Windows 8...

Silverlight Textbox doesn't support the UIA Text pattern

$
0
0

We have blind users who cannot use our silverlight web application.  They have trouble immediately on the login page because they cannot enter and edit entries in the text boxes.

According to the deveopers of JAWS, a popular software for the blind, the TextBox Silverlight control has bad accessibility because it doesn't support the UIA Text pattern. They recommend using instead the RichTextBox.

But the RichTextBox is much more complex than what we need for simply entering text and numbers, so it would be bad for performance if used throughout our system.

Is there some other simple control we could use instead of the textbox, or is there some way to make the textbox accessible?

ui spy find text but cannot find it with ui automation element

$
0
0

I want to read text out of a custom label in a mail item form of Outlook 2010.

With the normal mailItem.Userproperties or ItemProperties, the Label does'nt come.

So I'm trying to get the text with AutomationElement in c#.The text is visible, I can read the text, but may be an other Textbox/Label lay over it with transperancy. In Outlook the Label has a Name.

I started UI Spy.exe and the software show me the text like this:

Identification:

...

 Name: ""

ControlPaterns

 Value

   Value: SearchedText

I tried a lot to get the SearchedText with the AutomationElement, but nothing can find the element, or get the SearchedText.

AfxOleControl42 Set Text

$
0
0

I'm currently building an application that will interact with another application via sending text to textbox controls, clicking buttons, etc (general Windows Automation stuff).  I am building this app with C# 4.0 framework.

I'm struggling setting the text of a control that has a type of AfxOleControl42.

I verified I grab the proper control (handle id) via Spy++, because when I log messages in Spy++, when I send text to the particular textbox control (of type AfxOleControl42), it tells me that I'm keydowning and keyupping in the expected handle id.

However, when I try to interact with this textbox control programmatically, I am unable to

I've tried the following methods:

  1. SendMessage(int, WM_SETTEXT, 0, STRING_TO_SEND)
  2. SendMessage(int, WM_KEYDOWN (and then WM_KEYUP), 0, STRING_TO_SEND)
  3. PostMessage()
  4. Clipboard paste
  5. Used AutomationElement object...((ValuePattern)valuePattern).SetValue(value);
  6. System.Windows.Forms.SendKeys.Send() and .SendDelay()

When using AutomationElements, and I try to set focus, I get an exception "Target element cannot receive focus".

Has anyone had issues with this type of control before?  I have no idea why the developer didn't just use a TextBox control, instead of AfxOleControl42, but it seems more like a Panel than a TextBox...

**Edit:  This is on a Windows 7 machine***


Building My own tts engine with my voice

$
0
0

Hello all,

I'm a blind programmer.

I'm using visual studio 2010 and .net framework 4.5.

I'm interested in Sapi tecnology, to build my own tts engine, recording my voice.

I cannot find any documentation that can help me to build my tts eengine.

It is possible to do it with sapi Technologies?

Can someone help me to find any documentation?

Access MS Accesability Properties (name, helptext) of ListBox item(child) in General

$
0
0

Is there a was to access the accessible Object of childs (items) of ListBoxes to change their MSAA propperties (name, helptext)?

It is a WinForm Application.

 And is there a general good way (how to)  to implement MSAA in an WinForms application for Coded Ui Testing?


Is there anyway to implement UI Automation test via C# for Metro App

$
0
0

Dose the managed UI Automation Framework support automating Win8 Metro Apps?

Welcome to the Windows Accessibility and Automation Development Forum

$
0
0

Hello all,

 

The scope of the UI Automation forum has expanded to cover all Microsoft accessibility/automation technologies, including UI Automation and Microsoft Active Accessibility. This forum is for discussion of software development, not end-user issues.

 

The typical user of this forum will be:

  • A developer who needs to make a control accessible. 
  • A developer who needs to create an assistive technology such as a screen reader, screen magnifier, on screen keyboard, command & control utility, etc.
  • A developer who wants to create test automation for a GUI. 

When posting issues to the forum please clearly identify the technology you are using, as well as whether you are developing a server/provider component or a client application. 

 

This is a community forum sponsored and moderated by Microsoft, and we hope it provides a place for information to be exchanged. The moderators will also do their best to point you to the information you need, but please keep in mind that we cannot offer support on blocking issues or attempt to resolve bugs.

 

Thanks.

 

 

 

 


 

UIAutomation stackoverflow exception rootelement.findfirst

$
0
0

I am trying to use System.Windows.Automation to automate GUI regression testing. In the constructor of my test object, I launch the application and locate it in the tree with AutomationElement.RootElement.FindFirst, and I limit the scope of the search to children. I getting a stackoverflowexception every time I run my test just to launch the application and locate the form. Any help wold be greatly appreciated. My constructor:

<!-- language: c# -->
public GuiTest(string inFormName, string inExecutable, Dictionary<string, ControlTypes> inElements)
{
    //Start the GUI
    myProcess = Process.Start(inExecutable);

    //We have to give the application time to fire up
    int count = 0;
    do
    {
        //Get the root element of the GUI
        myParentElement = AutomationElement.RootElement.FindFirst
            (TreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, inFormName));
    }while(myParentElement == null && count < 50);

    if (myParentElement == null)
    {
        throw new InvalidOperationException("Could not find form " + inFormName);
    }

    //Get the buttons and stuff
    LoadElements(inElements);    
}



Performance counters are not collecting data

$
0
0

Hi,

I am a bit unsure how to explain my problem, so bear with me.

I Building synthetic user simulation for integration into a monitoring system (SCOM 2012). To do this I write small tests of a proprietary application that simulates certain actions. For these tests I use AutoIT - a scripting Tool that lets you automate Windows interaction. In AutoIT I then call a small program I wrote. This program has 3 parameters:

install: installs my performance counters

list: lists the counters

publish: take an additional 2 params, name of the counter, value to publish to the counter

This Works fine when I run it manually. I can see in perfmon that the data is correctly published.

Now, I need to run these simulations on a Schedule, so I changed the Task Scheduler service to allow interact with desktop and then I run the AutoIT scripts from a task Schedule. I see the programs are running fine with no problems - only a small exception... no data is published to the performance counters. Leave the machine on which I run these tests, logged on and not locked (some issues with automation block me from running this on a locked machine).

The Schedule is set to run with my account, so from that perspective Things *should* be fine.

The bomb for me right now is that, if I log on to the machine, start perfmon and the manually run the autoit scripts one time - the perfcounters get the published data ... AND the scheduled task correctly publishes data to the counters too. I'm confused :)

I Wonder if there is something around initialization or something else I'm missing in my code - which is super simple. I have these pieces of VB.NET:

Init a counter looks like this:

        Dim CounterDatas As New CounterCreationDataCollection()
        ' Create the counters and set their properties.
        Dim cdCounter1 As New CounterCreationData()
        cdCounter1.CounterName = "OpenApp_1_Open"
        cdCounter1.CounterHelp = "Help"
        cdCounter1.CounterType = PerformanceCounterType.NumberOfItems64
        CounterDatas.Add(cdCounter1)
        PerformanceCounterCategory.Create("ProArc", _
            "ProArc Category Help", PerformanceCounterCategoryType.SingleInstance, _
            CounterDatas)

Writing to a counter looks like this:

        Try
            Dim PC As New PerformanceCounter("ProArc", countername, False)
            PC.RawValue = datavalue
            PC.NextValue()
            Console.WriteLine(countername & " < " & datavalue)
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try

DataGridView Extended to implement UI Automation

$
0
0
 

There seem to be many developers on this forum who are trying to use UI Automation to test a WinForm DataGridView control.

 

Please let us all know where there is an example of an implementation of the ITransformProvider, IGridProvider, and IGridItemProvider interfaces, or when such an example will be made available.

 

Ease of Access registration help?

$
0
0
Hopefully someone here can offer some guidance from the following...
Re: Ease of Access – Assistive Technology Registration - http://msdn.microsoft.com/en-us/windows/bb879984.aspx

I have my accessibility application (an on-screen keyboard) mostly working from following the information in the above link. It starts up for logon and after logon (at the "desktop"). But I do have some problems.

From the link: "If your accessibility application is configured to run in a job, your application's startup code should include a call to the IsProcessInJob function to determine whether the application is starting in a job. If it is, the application should start the Ease of Access Center and then exit. The following example shows how to call IsProcessInJob.

BOOL fAlreadyInJob;

BOOL fSuccess = IsProcessInJob(GetCurrentProcess(), NULL, &fAlreadyInJob); 

If the accessibility application is configured to run outside of a job, it should notify the Ease of Access Center that the application is starting and continue as normal.

Regardless of how the application is configured, if it provides a way to exit from within the application, such as a Close button, the application must notify the Ease of Access Center that it is exiting.

An application notifies the Ease of Access Center by setting a temporary registry key and then injecting the Windows Logo key + U key combination into the input stream.

The application should create the temporary key at the following location.

HKCU\Software\Microsoft\Windows NT\CurrentVersion\AccessibilityTemp

The temporary key should have the same name as the registered application name, such as "Contoso_Screen Reader_v1.0". The value of the key is a DWORD set to 0x0003 when it is starting, or 0x0002 when the application is exiting."

My application runs as a "job". If it checks IsProcessInJob, then injects Windows+U, then exits the user is left staring at the Ease of Access. I put the proper values at the key specified. Why?

From: "Transferring secure desktop settings

If your accessibility application supports the secure desktop, you can use the registry to copy settings when the application transitions to the secure desktop. Copying settings helps makes the transition to the secure desktop more seamless for the user.

To copy settings, set the application's CopySettingsToLockedDesktop registry key to 1, and store the settings in the following registry location.

HKCU\Software\Microsoft\Windows NT\CurrentVersion\Accessibility\ATConfig\<AT Key Name>

The Ease of Access Center monitors this registry location while the application is running. When a transition to the secure desktop occurs, the Ease of Access Center copies the settings to the same location in the secure desktop’s HKCU hive. The application can then read the settings and resume its state."

My app does support secure desktop. Again, this does not behave as documented. I save my settings as per the above but when switched to secure desktop the settings are not there to be read. It appears they are not copied, why?

And finally, from: "Running at installation and on the logon desktop

If you append your accessibility application's registered key name to the string at the following registry location, Windows will launch your application immediately after it is installed. Also, Windows will automatically run your application whenever the logon desktop is active.

HKCU\Software\Microsoft\Windows NT\CurrentVersion\Accessibility\Configuration

The Configuration key is a comma-delimited string. To add your application, append a string that is the same as your application's registry key at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility\ATs\."

The above does not "launch my application immediately after it is installed". Why?

Are there any working examples of this registration process?

Thanks for any help!

Find Element Issue

$
0
0

I am trying to find a list item from a Windows Forms list using UI Automation. In some cases it fails and I don't understand why.

Failed cases:

  • Searching with AutomationElement.FindFirst from the same application
  • Searching with TreeWalker.RawViewWalker from the same application

Passed cases:

  • The above, but from a different, smaller test application
  • Inspect Objects tool

With other WPF and Windows Forms controls I had no problem. Can you please help me understand what happens?


UIVerify - ComboBox GetCurrentPatter returns error

$
0
0

I was having trouble using the ValuePattern on a ComboBox.  Inspect tells me the ValuePattern is available, but when I try to use it, I get an error back telling me it's an Unsupported Pattern.

I decided to look at UIVerify to run tests on the ComboBox and got a little more information.

Please Help!!!

Description:
Verify success
call to GetCurrentPattern(*Pattern.PatternObject)
Message: Value cannot be null. Parameter name:
property
Unexpected: true
Known Bug: false

Incorrect Configuration: false

Description:

Verify success
call to all GetCurrentPropertyValue(AutomationElement property)

Message: Object reference not set to an instance of an
object.
Unexpected: true
Known Bug: false

Incorrect Configuration: false


closl

Capturing text under mouse cursor using MSAA.

$
0
0

Looking for source code or library to read the screen text of an object under the mouse cursor in any application (E.g. such as when the user is viewing a PDF/Website/MS Office etc).

I would like to build an application that runs in the system tray, that allows the user to mouse over text, parse it and play it back or just pass it on to another custom application that I make. In a way it is like a screenreader.

The target platform is Windows 7 or later.

I would prefer to use it from C# or Java.


Windows Automation and EDRMSs

$
0
0

I have used windows automation a lot in the past but have moved to a new organisation which has recently introduced an EDRMS (M-Files) of which I have no previous experience. I would appreciate some guidance on how to transfer the functionality I am familiar with to a virtual file structure which isn't visible to me. 

Thanks,

Gerry

Could somebody explain when I pass a control's AutomationID, how the code find the correct control and invoke the supported methods?

$
0
0

Hello All,

Could somebody explain when I pass a control's AutomationID, how the code find the correct control and invoke the supported methods? (Assume I use UIAutomation technology and write the codes in C#) And what's difference between MSAA and UIAutomation ?


thanks, eric

unregister Keyboard device using RIDEV_REMOVE not working

$
0
0

Hi there,

I have implemented the raw input method for handling the keyboard inputs for an external application. The code is working absolutely fine and I am able to handle all the events but there is a button in this external application which opens an outlook new mail window as a modal dialog box(same as the Send->Email functionality in MS-Excel 2007).

As soon as this mail window modal dialog opens, I am not able to type anything in this mail window, not even the address in the address bar.

On deep diagnosis, I found that the raw input method is consuming all the key data and don't let it pass to the outlook window.

To get rid of this problem, I have overridden the WndProc() method and tried to unregister the keyboard on the deactivation of application's main window(because whenever modal dialog opens, the application's main window deactivates). The code for unregistering keyboard that I wrote is as follows:

 public void UnRegisterKeyboardDevice()
        {
            uint i = 0;                      
            RAWINPUTDEVICE[] rid = new RAWINPUTDEVICE[1];
            rid[0].usUsagePage = 0x01;
            rid[0].usUsage = 0x06;
            rid[0].dwFlags = RIDEV_REMOVE;
            rid[0].hwndTarget = IntPtr.Zero;

            if (!RegisterRawInputDevices(rid, (uint)rid.Length, (uint)Marshal.SizeOf(rid[0])))
            {
                throw new ApplicationException("Failed to register raw input device(s).");
            }           
        }

But This code is not working for the first time i.e. whenever I click on the button, It opens the outlook modal mail window but I am not able to type anything(same as earlier) but If I close this window and again click on the button then again a new mail window opens and this time I am able to type anything and everything required.

In simple words, the code above is not working for the first time but the next time it works fine.

I am using Visual studio 2010 ultimate on Windows 7 environment.

I have tried to debug the code but didn't received any errors or exceptions while debugging.

But while debugging I found that sometimes while debugging, it works for the first time also.

I hope the problem statement is clear.

Please Help.

Thanks

Viewing all 585 articles
Browse latest View live


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