Improving the command API to test GUIs