XAccessibleContext buttonContext = at.getAccessibleObjectForRole(
xRoot,
AccessibleRole.PUSH_BUTTON,
createButton);
XAccessibleAction buttonAction = (XAccessibleAction) UnoRuntime.queryInterface(
XAccessibleAction.class,
buttonContext);
try {
System.out.println("Name: " +
buttonContext.getAccessibleName());
buttonAction.doAccessibleAction(0);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
System.out.println("Couldn't press button");
}
shortWait();