It's helpful to make sure that element is exist. You can use waitForElementExistence. This will solve your problem.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: