title: How to perform actions on child iFrame using Selenium?
body: <p>How can we perform actions on iFrame which is in a iFrame?</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="div1"&gt;
   &lt;iframe id="iframe1"&gt;
     &lt;div id="div2"&gt;
       &lt;iframe id="iframe2"&gt;
       &lt;/iframe&gt;
     &lt;/div&gt;
     &lt;div id="div3"&gt;
       &lt;iframe id="iframe3"&gt;
       &lt;/iframe&gt;
     &lt;/div&gt;
   &lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I need to perform actions on iframe2 and iframe3. Tried with the following code:</p>
  
  <pre><code>1. driver.switchTo().frame("iframe1.0.iframe2");
  2. WebElement firstFrame = driver.findElement(By.id("iframe1"));
     driver.switchTo().frame(firstFrame);
     WebElement secondFrame = driver.findElement(By.id("iframe2"));
     driver.switchTo().frame(secondFrame);
  </code></pre>
  
  <p>but couldn't resolve the issue.</p>
  
  <p>Please suggest if any other method to be followed.</p>