title: I want to check whether frame exists or not on web page by using Selenium, how can do it
body: <p>After login to my application, sometimes a frame opens, which requires a click on the 'OK' button.
  So, I have written the code below which switches to the frame, clicks on the OK button and again switches to default.</p>
  
  <pre><code>driver.switchTo().frame(driver.findElement(By.id("InlineDialog_Iframe")));
  driver.findElement(By.id(prop.getProperty("pending_email_close_btn_id"))).click();
  driver.switchTo().defaultContent();
  </code></pre>
  
  <p>But, if frame doesn't appear then code gives error saying that the frame doesn't exist.</p>
  
  <p>Please let me know how can I check whether the frame exists or not by using 'if' loop or by any other method?</p>
  
  <p>Thanks.</p>