Fix handling main_panel switching in various Selenium tests. #4003
PR #3992 fixed "with self.main_panel()" so that leaving the context actually restore the Selenium context back to the top level page. This surfaced a bunch of bugs related to assertions that were operating in the main panel without declaring it. This fixes those and makes the assertions a bit stronger - such as verifying error messages being asserted about are visible.