Firefox fails tree traversal, further investigation shows messed tree hierarchy

78 views Asked by At

I am using UIA to traverse through Firefox element tree. I am creating paths between multiple nodes in the tree. This however is running into problems because there seems to be mix up of elements in the tree. That is there are duplicate runtime ids and the hierarchy is all messed up.

The UI Spy application shows following exception

"UI Automation tree navigation is broken. The parent of one of the descendants exist but the descendant is not the child of the parent"

How do I resolve this issue? Any help is appreciated.

1

There are 1 answers

0
Satish Rao On

I got help from a Firefox dev team working on accessibility to resolve this issue in my initial tests atleast.

It turns out that Firefox does not natively support Microsoft UIA, it however does support Microsoft MSAA which is an older accessibility framework. Thus Firefox relies on an MSAA Proxy for supporting UIA, this proxy consumes MSAA information and provides it to requests via UIA API.

The runtimeId(unique id for elements) generation in MSAA and its compatibility with UIA via proxy is not well documented as far as the Firefox dev team knows. This might cause the above problem when using UIA for tree traversal.

The Firefox team indicated that adding a boolean preference to about:config in Firefox will provide limited and experimental support to UIA and runtimeids should be in that limited support.

I added this value in about:config and was able to get positive results in the preliminary tests that I performed

.

To add this value to Firefox config.

  1. Start a Firefox instance

  2. Type "about:config" in the address bar

  3. Once the config screen is shown, Right Click+New+Boolean.

  4. Add a preference called "accessibility.uia.enable" and make sure the value is "true"