title: Unable to switch to frame using web driver
body: <p>I'm unable to switch to the frame since it does not have a name or an ID. I need to be able to enter a value into the input fields. </p>
  
  <p>Webpage: <a href="http://phptravels.net/flightsw" rel="nofollow noreferrer">http://phptravels.net/flightsw</a></p>
  
  <p>Frame: </p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html class=" js flexbox canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths" lang="en"&gt;
  &lt;head&gt;
  &lt;body id="flights" class="home"&gt;
  &lt;a href="http://www.phptravels.net"&gt;
  &lt;link href="https://dl.dropbox.com/s/drqq1bid1y9x7qu/wego.css?dl=0" rel="stylesheet" media="screen"&gt;
  &lt;link rel="shortcut icon" href="http://phptravels.net/uploads/global/favicon.png"&gt;
  &lt;header&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div id="content"&gt;
  &lt;div id="wan-flights-form" style="display: block;"&gt;
  &lt;div class="wan-wrap"&gt;
  &lt;form id="wg_flight_search" accept-charset="UTF-8" action="" method="post"&gt;
  &lt;div style="margin:0;padding:0;display:inline"&gt;
  &lt;h3&gt;
  &lt;fieldset&gt;
  &lt;span class="form-triptype"&gt;
  &lt;span class="form-from"&gt;
  &lt;span class="form-to"&gt;
  &lt;span class="form-date"&gt;
  &lt;span class="form-date"&gt;
  &lt;span class="form-cabin-class"&gt;
  &lt;span class="form-extrafields"&gt;
  &lt;span class="form-button"&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;div class="clearfix"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="expand-container"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="wan-top-flights-destinations"&gt;
  &lt;script id="template-flight-destination" type="text/html"&gt;
  &lt;div id="wan-flights-results"&gt;
  &lt;script id="template-out-of" type="text/mustache"&gt;
  &lt;script id="template-found" type="text/mustache"&gt;
  &lt;script id="template-flight-card" type="text/mustache"&gt;
  &lt;script id="template-airline-card" type="text/mustache"&gt;
  &lt;script id="template-flight-details" type="text/mustache"&gt;
  &lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;footer&gt;
  &lt;div class="flights-info-bar"&gt;
  &lt;script src="/assets/shared/theme-af487a9f719ca343821ae5a49209ad72.js" type="text/javascript"&gt;
  &lt;script src="/assets/generate/javascripts/customisations.js" type="text/javascript"&gt;
  &lt;div id="lightboxOverlay" class="lightboxOverlay" style="display: none;"&gt;&lt;/div&gt;
  &lt;div id="lightbox" class="lightbox" style="display: none;"&gt;
  &lt;ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all" role="listbox" aria-activedescendant="ui-active-menuitem" style="z-index: 1; top: 0px; left: 0px; display: none;"&gt;&lt;/ul&gt;
  &lt;ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all" role="listbox" aria-activedescendant="ui-active-menuitem" style="z-index: 1; top: 0px; left: 0px; display: none;"&gt;&lt;/ul&gt;
  &lt;div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;/iframe&gt;
  </code></pre>
  
  <p>I tried the following(However not working since the ID is not correct:</p>
  
  <pre><code>driver.switchTo().frame(driver.findElement(By.id("wg_flight_search"))); 
  
  Exception in thread "main" org.openqa.selenium.NoSuchElementException: Could not find element: {"using":"id","value":"flights_search_to_location_name"} (WARNING: The server did not provide any stacktrace information)
  Command duration or timeout: 8 milliseconds
  </code></pre>
  
  <p>Below line is what I would like to execute once the switch happens.</p>
  
  <pre><code>driver.findElement(By.id("flights_search_to_location_name")).sendKeys("Miami");
  </code></pre>