var window = application.mainWindow(); var view = window.elements()[0]; Simple Script var buttons = window.buttons(); // Check for a button on screen if (buttons.length != 1) { UIALogger.logFail("FAIL: The button is missing."); } else { UIALogger.logPass("PASS: There is a button on the screen."); }