Catch exception in wait element method, switch to main frame in FTD.