Code for yahoo mail sign out
FirefoxDriver driver = new FirefoxDriver();
driver.get("https://login.yahoo.com/config/login_verify2?.intl=ca&.src=ym");
driver.manage().window().maximize();
WebElement element = driver.findElement(By.id("username"));
element.sendKeys("myid@yahoo.com");
driver.findElement(By.id("passwd")).sendKeys("mypassword");
element.submit();
Thread.sleep(40000);
driver.findElement(By.linkText("Sign Out")).click();
Thread.sleep(40);
FirefoxDriver driver = new FirefoxDriver();
driver.get("https://login.yahoo.com/config/login_verify2?.intl=ca&.src=ym");
driver.manage().window().maximize();
WebElement element = driver.findElement(By.id("username"));
element.sendKeys("myid@yahoo.com");
driver.findElement(By.id("passwd")).sendKeys("mypassword");
element.submit();
Thread.sleep(40000);
driver.findElement(By.linkText("Sign Out")).click();
Thread.sleep(40);