title: How to access menu items?
body: <p>I have a fully functional nw.js app running on Ubuntu 20.04. I am able to use ruby's selenium-webdriver gem to access the app's web components (written in angular). I am able to get access to the components on the main window, click on buttons and so on. Works great.</p>
  <pre><code>require 'selenium'
  require 'selenium-webdriver'
  </code></pre>
  <p>But I have not been able to access the nw.js menu. I have a MenuItem called &quot;Info&quot; for example and there is no way to click it from the ruby script. The menu works correctly when I click on it manually. But the Selenium ruby script can't seem to access it.</p>
  <p>I tried to add a key sequence to get to the MenuItem. Again, works fine manually &quot;Alt-I&quot;, but when I use</p>
  <pre><code>web.driver.action.key_down(:alt).send_keys('i').perform
  </code></pre>
  <p>it fails. As far as I can see this line has no effect.</p>
  <p>The nw.js documentation has no information about this, or any example code that I can find. I tried google and again no example code that I can see.</p>
  <p>If you have this working in ruby or python (I can translate it) please post.</p>
  <p>EDIT: here's the relevant menu code:</p>
  <pre><code>export class MenuService {
      public menubar: nw.Menu;
      private info_menu: nw.MenuItem
      &lt;snip&gt;
  
    this.menubar = new window.nw.Menu({
              type: 'menubar'
          });
  
          // add submenu to the menubar
          this.info_menu = new window.nw.MenuItem({
              label: 'Info',
              tooltip: 'Get info',
              key: 'i',
              modifiers: 'alt',
              click: () =&gt; {
                  this.show_info()
              }
          })
          this.menubar.append(this.info_menu)
  
   &lt;snip&gt;
   }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/uV8tP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uV8tP.png" alt="menu screenshot" /></a></p>