public boolean checkPopupWindow(){ try{ driver.switchTo().window(nameOrHandle); }catch (NoSuchWindowException e){ return false; } return true; }