 
         // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
 		let tabBarsQuery = app.tabBars
-		tabBarsQuery.buttons["Interactions"].tap()
+
+		while (!app.navigationBars["Interactions"].exists) {
+			tabBarsQuery.buttons["Interactions"].tap()
+		}
+
 		let actionButton = app.navigationBars["Interactions"].buttons["Share"]
 		let enabled = NSPredicate(format: "enabled == 1")
 		expectationForPredicate(enabled, evaluatedWithObject: actionButton, handler: nil)

		// Close message center
		app.navigationBars["Message Center"].buttons["Close"].tap()
    }
}

		}

        // Put setup code here. This method is called before the invocation of each test method in the class.
		app.launchArguments = [ "-APIKey", APIKey, "-events", "<array><string>launch_survey</string><string>other_survey</string></array>" ]
        
        // In UI tests it is usually best to stop immediately when a failure occurs.
        continueAfterFailure = false
