I’m trying to write scripts in JavaScripts to test the UI of an iPhone app with MonkeyTalk. How do I use logic and conditionals with this? Right now I have a block:
if (this.app.button("name").verify())
do this if button exists
The problem is verify doesn’t return a bool, it just throws an error in the test if the button doesn’t exist. Is there a way to catch the error and run a script accordingly?
This seems to work :
and you can just call it as such :