BACKGROUND:

When calling the TypeKeys method against a FlexMenuBar control, for example to navigate, the menu navigation does not playback successfully. However, when using the Type method, the actions are successfully replayed. Therefore, what are the keycodes a user can specify when calling the Type method against a supported Flex object? Are the keycodes similar to that available for the TypeKeys method?

SOLUTION:

The TypeKeys method not exhibiting the expected behaviour when called against a FlexMenuBar control is in fact a correct behaviour as the TypeKeys method is executed by the agent against the application and not against the Flex control.  To invoke a keystroke against a supported Flex control, we need to use the available method associated with the Flex control.  For example, using a FlexMenuBar, according to the API reference of the FlexMenuBar control, the available method is the Type method.

The Type method takes a string as an argument.  This string can only be a keyCode, subsequently, if you use the Type method against a FlexTextArea control to set a value in the control (note: normally we would use the input method to set a value in a FlexTextArea control), this will produce an error.

For exampe:
          FlexTextArea.Type("RIGHT") : this is incorrect as a FlexTextArea control cannot replay the key event
          FlexTextArea.Input("RIGHT") : this will correctly replay the key event and input the value specified in the string argument

Therefore, to perform menu navigation of a FlexMenuBar, using the Type method is the correct approach rather than the TypeKeys method.  Below are the list of keyCodes for use with the Flex Type method.

          BACKSPACE
          CAPSLOCK
          CONTROL
          DELETEKEY
          DOWN
          END
          ENTER
          ESCAPE
          HOME
          INSERT
          LEFT
          PGDN
          PGUP
          RIGHT
          SHIFT
          SPACE
          TAB
          UP

          Function keys:
                    F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12

          If key modifiers are required, then the type method takes a second parameter as shown below:
                    FlexObject.Type("HOME", ModifierKey.Ctrl)