2 ways:
1) Build a test-enabled version of your page. Either build a separate page that simulates these messages based on some other user action in the page, like clicking a button, or enable/disable this functionality via a URL param, which you can pass through S.open.
2) I've been working the past couple weeks on a new FuncUnit architecture, which will make this loads easier. There won't be a Selenium/browser distinction, so you'll be able to access anything in the app window via S._window.