UI Automation of CefSharp window not possible

360 views Asked by At

I'm trying to make CefSharp window accessible with MS UI Automation tools like inspect.exe or UISpy. By default the CefSharp windows is treated by these as an image and the UI properties are inaccessible.

I've set the commandline argument "force-renderer-accessibility". Itself it didn't change anything, but then I added this code:

browser.AccessibilityHandler = new AccessibilityHandler(browser);
browser.IsBrowserInitializedChanged += (sender, args) =>
{
    if ((bool)args.NewValue)
    {
        browser.GetBrowserHost().SetAccessibilityState(CefState.Enabled);
    }
};

It partially worked, I can access most of the controls, but some of them are still inaccessible (they are referred to by UISpy as 'group' and you can't traverse them deeper as tree nodes). Also the scan finds some items a bit away from their real position.

Is there a better way to make CefSharp WPF window available to UI automation tools? Is there something I'm doing wrong?

I'm using CefSharp 97.1.12

0

There are 0 answers