title: Click link under navigation bar in Selenium Webdriver
body: <p>I am trying to click the link under the navigation bar. I tried driver.findelement in this code snippet. It selects the link but the click event is not taking place.</p>
  
  <pre><code>WebElement menu=driver.findElement(By.xpath(".//*[@id='bs-example-navbar-collapse-1']"));
           //WebElement menu = driver.findElement(By.XPATH("Coplete_navigationbar_xpath")); List&lt;WebElement&gt; 
           List&lt;WebElement&gt;  allLinks = menu.findElements(By.tagName("a"));
           String MenuOptn="";
           for (WebElement w : allLinks)
           {
               MenuOptn=w.getText();
               if(MenuOptn.equalsIgnoreCase("TRACKING"))
               {
                  // System.out.println("tracking");
                   w.click();
                   System.out.println("tracking");
                   break;
               }
  System.out.print(w.getText());
           }
  </code></pre>