wait for button to appear

Is there a better way to do this?