access-bridge-explorer
access-bridge-explorer copied to clipboard
System.ApplicationException when trying to call GetInfo() on AccessibleContextNode
I am trying to automate UI of "FileChooserDemo.jar" application distributed with jdk-8u121-windows-x64-demos. There is a button on the UI "Show FileChooser". I perform the click operation on the button as follows :
//accessBridge has been initialized and hWnd is the handle of the initial window that opens
//by launching FileChooserDemo.jar
AccessibleWindow initialWindow = accessBridge.CreateAccessibleWindow(hWnd) ;
//FindTargetControl() will find the control inside initialWindow provided control lookup details
AccessibleContextNode targetControl = FindTargetControl(some parameters);
AccessibleActionsToDo actionsToDo = new AccessibleActionsToDo()
{
actions = new AccessibleActionInfo[32],
actionsCount =1
};
actionsToDo.actions[0] = new AccessibleActionInfo() { name = "click" };
int failure;
targetControl.AccessBridge.Functions.DoAccessibleActions(targetControl.JvmId, targetControl.AccessibleContextHandle,ref actionsToDo, out failure);
This opens a new dialog window.
Scenario 1 : If i now try to call GetInfo() on the initialWindow , I get a System.ApplicationException . Also, at this point if i try to call accessBridge.EnumJvms() , the call will never return;
Scenario 2 : If instead of using the API to perform click, i will lookup the control bounding box and perform a click on it using mouse , i can now perform both the above operations.
Since the call to DoAccessibleActions() returns after performing the click , I would like to understand if performing a operation such as click using API which opens a dialog window is a blocking operation which prevents any attempt to interact with the AccessibleWindow or trying to EnumJvms() ? Please provide any possible workaround . Also, I am not sure if this is a bug or expected behavior. Request to please tag it appropriately.
Regards, Nish26