@Test
public void testTom() throws Exception {
driver.get(baseUrl + "/webmail/login/index.action");
Thread.sleep(2000);
//tom mail login
driver.findElement(By.id("username")).clear();
driver.findElement(By.id("username")).sendKeys("username");
Thread.sleep(2000);
driver.findElement(By.id("password3_$loginhash")).clear();
driver.findElement(By.id("password")).sendKeys(" password");
Thread.sleep(2000);
driver.findElement(By.cssSelector("#login > img")).click();
Thread.sleep(2000);
driver.findElement(By.xpath("//ul[@id='ulTabs']/li[3]/span")).click();
driver.findElement(By.id("pop_close")).click();
//send mail to xxxxx@tom.com
driver.findElement(By.id("webmail_sys_write")).click();
driver.findElement(By.id("tob")).click();
driver.findElement(By.id("tob")).clear();
driver.findElement(By.id("tob")).sendKeys("xxxx@tom.com");
driver.findElement(By.id("subject")).clear();
driver.findElement(By.id("subject")).sendKeys("zhuti");
//send mail content
WebElement cont = driver.switchTo().frame(driver.findElement(By.id("xhEdt0_iframe"))).findElement(By.className("editMode"));
cont.sendKeys("郵件的內(nèi)容!。");
driver.switchTo().defaultContent();
driver.findElement(By.cssSelector("span[name="sendMail"]")).click();
driver.findElement(By.id("logout")).click();
driver.findElement(By.xpath("//button[@type='button']")).click();
driver.findElement(By.xpath("//button[@type='button']")).click();
}
@After
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}