title: Not able to switch in between frames in web driver
body: <pre><code>&lt;iframe id="vacancy_department_requirements_ifr" frameborder="0" src="javascript:""" allowtransparency="true" title="Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help" style="width: 100%; height: 100px; display: block;"&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  </code></pre>
  
  <p>I am having problem in switching the iframes while automating the application using webdriver. There are three texteditor. And when I do inspect element then at the same iframe id the id changes. so I am unable to switch in between the frames.</p>
  
  <p>I wrote the following code:-</p>
  
  <pre><code>wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("vacancy_job_requirements_ifr"));
  
  
  WebElement element2 = driver.findElement(By.cssSelector("body"));
  JavascriptExecutor executor3 = (JavascriptExecutor)driver;
  executor3.executeScript("arguments[0].innerHTML = '&lt;h1&gt;Set text using innerHTML2&lt;/h1&gt;'", element2);
          */
          /*wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("vacancy_job_description_ifr"));
  
  WebElement element3 = driver.findElement(By.cssSelector("body"));
  JavascriptExecutor executor4 = (JavascriptExecutor)driver;
  executor4.executeScript("arguments[0].innerHTML = '&lt;h1&gt;Set text using innerHTML2 gf&lt;/h1&gt;'", element3);
  
  
          wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("vacancy_department_requirements_ifr"));
   WebElement element4 = driver.findElement(By.cssSelector("body"));
  JavascriptExecutor executor5 = (JavascriptExecutor)driver;
  executor5.executeScript("arguments[0].innerHTML = '&lt;h1&gt;Set text using innerHTML3 gf&lt;/h1&gt;'", element4);*/
  </code></pre>
  
  <p>But the above code is giving me following error:
  <code>"Timed out after 120 seconds waiting for frame to be available: vacancy_job_description_ifr'</code></p>
  
  <p>Please suggest.</p>