title: selenium Test case for facebook login and logout
body: <p>Scenario is to Login to facebook account and then logout. I tried using xpath className and id. But everytime it shows error as ElementNotfound or element not visible. Later I Checked it using SELENIUM IDE and got this xpath for the LOGOUT link. But still the error persists. Kindly help me. </p>
  
  <pre class="lang-java prettyprint-override"><code>public class FacebookLogin {
  
      public static void main(String[] args) throws InterruptedException {
          // TODO Auto-generated method stub
          WebDriver driver = new FirefoxDriver();
          driver.manage().window().maximize();
          driver.get("https://www.facebook.com/");
          Thread.sleep(2000);
          WebElement username = driver.findElement(By.id("email"));
          WebElement password = driver.findElement(By.id("pass"));
          WebElement Login = driver.findElement(By.id("u_0_v"));
          username.sendKeys("myusername@xyz.com");
          password.sendKeys("mypassword");
          Login.click();
          Thread.sleep(2000);
          //driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
          WebElement navigationclick = driver.findElement(By.id("logoutMenu"));
          WebElement logout = driver.findElement(By.xpath("//div[@id='u_d_1']/div/div/div/div/div/ul/li[12]/a/span/span"));
          navigationclick.click();
          if(logout.isEnabled() &amp;&amp; logout.isDisplayed()) {
              logout.click();
          }
          else {
              System.out.println("Element not found");
          }
  
      }
  
  }
  </code></pre>
  
  <p>HTML CODE FOR LOG OUT 
      
      
     
      
      
      
      
      Log Out
      
      </p>