title: How to navigate a subframe inside a frameset using Selenium WebDriver?
body: <p>I need to get the result from the table "td". But before I can do that I need to navigate a frame that contains it. The frame is one of the frameset elements that belongs to the mainFrame. I tried to use all types of navigating the "child" subframe non of which works: </p>
  
  <pre><code> driver.switchTo().defaultContent();
      Thread.sleep(1000);
       driver.switchTo().frame("mainFrame.0.fr_resultsNav~ResultsMaxGroupTemplate0.9766101221774707");
      driver.switchTo().frame("main.Frame.1.fr_resultsNav~ResultsMaxGroupTemplate0.8811790466176727");
  
  // even: driver.switchTo().frame("mainFrame.0.fs_main");
  </code></pre>
  
  <p>The following is the brief layout of the webpage:</p>
  
  <pre><code>&lt;frame src="banner.asp" name="topFrame" scrolling="no" noresize="noresize" id="topFrame" title="topFrame"&gt;
  
  &lt;frame src="" name="mainFrame" id="mainFrame" title="mainFrame" wd_frame_id_="5f4c10bc7e0960070bfda831655b8b0c"&gt;
  
      &lt;frameset id="fs_main" border="0" frameborder="no" framespacing="0" rows="70,87,*"&gt;
  .....................
  
          &lt;frameset id="fs_content" cols="23%,*" framespacing="0" frameborder="no"&gt;
  .....................
              &lt;frameset cols="*,9" id="LeftFrameSet" framespacing="0" frameborder="no"&gt;
  .....................
              &lt;frame frameborder="0" name="fr_classification~ResultsMaxGroupTemplate0.609021034867735" title="Results Classification Frame" id="fr_classification~ResultsMaxGroupTemplate0.609021034867735" src="/lnacui2api/results/shared/waitMessage.do?wmibIdRand=61_T16938265013_rand_1363544453847" scrolling="Auto" onload="paintResultsBorder('ResultsMaxGroupTemplate0.609021034867735');"&gt;
  
  ....................
  
  &lt;form name="results_listview_ResultsListForm" method="post" action="/lnacui2api/results/listview/listview.do" id="results_listview_ResultsListForm"&gt;
  
  ..........
  
  &lt;td nowrap="" height="20"&gt; &lt;span id="new"&gt;&amp;nbsp;All Results&lt;/span&gt; (294)&lt;/td&gt;
  &lt;/form&gt;
  
  ....................
  </code></pre>
  
  <p>Do I need to navigate the frameset before I can navigate a subframe? I read the documentation. All internet examples give a simple sample code: driver.switchTo().frame("mainFrame.0.child"). It does not work in this case. Please, take a look at the above script.</p>