That won't work because at this point you're at the System app frame, despite the app having launched. Marionette does not automatically switch frames.

Here's how we're going to do it:
```
system.broadcast_system_message(self.TESTING_SYSTEM_MESSAGE, self.TESTING_MESSAGE_PATTERN) 

self.wait_for_element_present(By.CSS_SELECTOR, 'iframe[src*="test-container"][src*="/index.html"]')
self.marionette.switch_to_frame(self.apps.displayed_app.frame)

# continue rest of the test
```
This works by detecting what is the top most (ie visible to the user) frame which is called the displayed_app  and then switch into it.
If for some reason the system message does not cause the app to load or it to load in the background then the step after this one will fail.
If I understand then this is an important part of the test case.