title: Verify Menu Buttons in Selenium
body: <p>I am working on script where navigating to Menu and clicking on menu button and it will navigate to specific page, again verifying if page title is as expected, then clicking on second menu button and repeating same process for all menu buttons. </p>
  
  <p>Here is html code </p>
  
  <pre><code>&lt;md-menu-content width="6" role="menu"&gt;
  &lt;md-menu-item&gt;
  &lt;button class="md-button md-ink-ripple" ng-transclude="" type="button" ng-click="gotoPost()" role="menuitem" aria-label="Create A Post"&gt;
  &lt;span class="ng-scope"&gt;Creae A Post&lt;/span&gt;
  &lt;div class="md-ripple-container" style=""/&gt;
  &lt;/button&gt;
  &lt;/md-menu-item&gt;
  &lt;md-menu-divider role="separator"/&gt;
  &lt;md-menu-item&gt;
  &lt;button class="md-button md-ink-ripple" ng-transclude="" type="button" ng-click="goToProfile()" role="menuitem" aria-label="PROFILE"&gt;
  &lt;span class="ng-scope"&gt;PROFILE&lt;/span&gt;
  &lt;div class="md-ripple-container" style=""/&gt;
  &lt;/button&gt;
  &lt;/md-menu-item&gt;
  &lt;md-menu-divider role="separator"/&gt;
    // And so on ..............
  </code></pre>
  
  <p>Here is my selenium code: </p>
  
  <p><strong>VERIFY PROFILE LINK</strong></p>
  
  <pre><code>WebElement mnuElement = driver.findElement(By.xpath("//html/body/access/allow-intent/allow-intent/allow-intent/allow-intent/allow-intent/allow-intent/allow-navigation/allow-navigation/main-navigation/div/md-menu/img"));
  // Move cursor to the Main Menu Element
      Actions builder = new Actions(driver);
     builder.moveToElement(mnuElement, 764, 90).click(mnuElement);
     builder.perform();
      // Giving 5 Secs for submenu to be displayed
      Thread.sleep(5000L);
       WebElement submnuElement = driver.findElement(By.xpath(".//*[@id='menu_container_3']/md-menu-content/md-menu-item[1]/button"));
      // Clicking on the Hidden SubMenu
      //driver.findElement(By.Id("sbEle")).Click();
       submnuElement.click();
          driver.manage().timeouts().implicitlyWait(10000, TimeUnit.SECONDS);
       //0OSP.SelectOption().click();
      //0driver.manage().timeouts().implicitlyWait(550, TimeUnit.SECONDS);
      //0OSP.Clicklogadive().click();
      //0driver.manage().timeouts().implicitlyWait(1000, TimeUnit.SECONDS);
      Recreational RC = new Recreational(driver); 
      System.out.println(driver.getCurrentUrl()); 
      driver.navigate().refresh();
  
      driver.manage().timeouts().implicitlyWait(10000, TimeUnit.SECONDS);
      String post= RC.Getrtitle().getText();
  
      System.out.println(post)
      Assert.assertEquals(post, "Create Post");
      System.out.println("\n! You have landed to the page: " +post + "Page");
      driver.navigate().back();
  
      // ************* VERIFY PROFILE LINK ***********************
      driver.manage().timeouts().implicitlyWait(1000, TimeUnit.SECONDS);
      WebElement mnuElement1 = driver.findElement(By.xpath("//html/body/access/allow-intent/allow-intent/allow-intent/allow-intent/allow-intent/allow-intent/allow-navigation/allow-navigation/main-navigation/div/md-menu/img"));
      // Move cursor to the Main Menu Element
      Actions builder1 = new Actions(driver);
     builder1.moveToElement(mnuElement1, 764, 90).click(mnuElement1);
     builder1.perform();
     Thread.sleep(5000L); // Giving 10Secs for submenu to be displayed
     WebElement submnuElement1 = driver.findElement(By.xpath(".//*[@id='menu_container_3']/md-menu-content/md-menu-item[2]/button"));
      // Clicking on the Hidden SubMenu
     submnuElement1.click();
     driver.manage().timeouts().implicitlyWait(10000, TimeUnit.SECONDS);
     Profile PF = new Profile(driver); 
     System.out.println(driver.getCurrentUrl()); 
     driver.navigate().refresh();
     driver.manage().timeouts().implicitlyWait(10000, TimeUnit.SECONDS);
  
     String profiletitle = PF.Getptitle().getText(); 
      Assert.assertEquals(profiletitle, "Profile");
      System.out.println("\n! You have landed to the page: " +profiletitle + "Page");
  </code></pre>
  
  <p>-- My script to clicking on create post menu button, going to that page, verifying page heading and going to back to home page. here I want to select second menu button but script stops at this point. </p>
  
  <p>Please help. </p>