title: Vaadin TestBench MenuBarElement - Not able to Select sub-menus with Integration Test
body: <p>I am implementing Vaadin Integration Test Case for the Menu Item as shown below</p>
  <pre><code> MenuBar.MenuItem homeMenu = menuItem.addItem(&quot;Home&quot;, null, null);
          homeMenu.addItem(&quot;Dashboard&quot;, homeMenuCommand);
          homeMenu.addItem(&quot;UserForm&quot;, homeMenuCommand);
  
          MenuBar.MenuItem studentsAdmissionYear = menuItem.addItem(&quot;Admission Year&quot;, null, null);
          studentsAdmissionYear.addItem(&quot;2018&quot;, myCommand);
          studentsAdmissionYear.addItem(&quot;2019&quot;, myCommand);
          studentsAdmissionYear.addItem(&quot;2020&quot;, myCommand);
          studentsAdmissionYear.addItem(&quot;2021&quot;, myCommand);
          studentsAdmissionYear.addItem(&quot;2022&quot;, myCommand);
  </code></pre>
  <p>And my Test Class is</p>
  <pre><code>package org.example;
  
  
  import com.vaadin.testbench.TestBenchTestCase;
  import com.vaadin.testbench.elements.*;
  import org.junit.After;
  import org.junit.Before;
  import org.junit.Test;
  import org.openqa.selenium.Keys;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  
      import java.net.MalformedURLException;
      import java.net.URL;
      
      import static org.junit.Assert.assertEquals;
      
      public class ApplicationFullIT extends TestBenchTestCase {
  
      WebDriver webDriver;
  
      @Before
      public void setUp() throws Exception {
          setDriver(new ChromeDriver());
          getDriver().get(&quot;http://localhost:8082/&quot;);
      }
  
      @Test
      public void testMenu() throws MalformedURLException {
          URL userFormUrl = new URL(&quot;http://localhost:8082/#!UserForm&quot;);
          MenuBarElement menuBarElement = $(MenuBarElement.class).first();
          menuBarElement.clickItem(&quot;Home&quot;,&quot;UserForm&quot;);
  
        //  assertEquals(getDriver().getCurrentUrl(),userFormUrl);
      }
  
      @After
      public void tearDown(){
          getDriver().quit();
      }
  }
  </code></pre>
  <p>The code</p>
  <pre><code>**MenuBarElement menuBarElement = $(MenuBarElement.class).first();
              menuBarElement.clickItem(&quot;Home&quot;,&quot;UserForm&quot;);**
  </code></pre>
  <p>works till selection of Home menu but not working with the sub menu &quot;UserForm&quot;</p>
  <p>Can you please help with a solution? I tried all possible solutions available by Googling but it is not helping me.</p>