title: How can I click a button inside a frame with selenium webdriver in VBA?
body: <p>I made an automation for a webpage which has frames, and I need to click on several menu links before returning to the maincontent to complete the tasks. This automation is run from Access-VBA. Here is a fragment of the HTML that shows the frame:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;frameset id="topFrameset"&gt; 
    &lt;frameset id="BodyFrameset" cols="0,177,*"&gt;
      &lt;frame name="ButtonsFrame" id="ButtonsFrame" target="main" scrolling="NO" noresize="" src="MyMenu.action"&gt;
        #document
        &lt;html&gt;
        &lt;body&gt;
          &lt;input type="hidden" name="listParentsId" value="[501, 502, 503]" id="listParentsId"&gt;
          &lt;div id="menu_container"&gt;
            &lt;div id="menu_1" onmouseover="MENU.ToolTipsCreate('501')"&gt;
              &lt;a onclick="MENU.showItems('501', '')"&gt;My Account&lt;/a&gt;
              &lt;img id="img_501" src="/common/images/dropdown2_arrow.png" onclick="MENU.showItems('501', '')"&gt;
            &lt;/div&gt;
          &lt;/div&gt;  
        &lt;/body&gt;&lt;/html&gt;
      &lt;/frame&gt;
    &lt;/frameset&gt;
  &lt;/frameset&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am using the <a href="https://github.com/florentbr/SeleniumBasic/releases" rel="nofollow noreferrer">SeleniumBasic v2.0.9.0</a> bindings for VBA. See <a href="https://codingislove.com/browser-automation-in-excel-selenium/" rel="nofollow noreferrer">Browser automation in Excel VBA using Selenium</a> for install and tutorial.</p>
  
  <p>I've tried webdriver.SwitchToFrame, among many other tests, all of them failed.</p>
  
  <pre><code>Dim driver As selenium.WebDriver
  Set driver = New ChromeDriver
  driver.Get (URL)
  
  'Here goes the part of the code that logs in the page, it's irrelevant for this analysis...
  
  driver.SwitchToFrame ("topFrameset") 'This line returns Error N°: 8 - NoSuchFrameError. Frame not be found. Identifier:topFrameset
  </code></pre>
  
  <p>Hope that someone could guide me to click the link or the img element inside "menu_1". Thanks in advance.</p>