Why is the app closing without test scripts being executed?

The app keeps closing automatically without test script getting executed. Please help me fix this.

Hi Michael,

In case you are looking for element by class XCUIElementTypeStaticText, you should mention the exact text that you are looking for in app. For example:

XCUIElementTypeStaticText[@text=“Your Exact Text”].

Also try adding wait just after driver is getting initialized.