Handling NoAlertException properly in BB Code tests.

Before it was possible that driver throws NoAlertException and we don't handle
it. Also moved that logic into common utils.