0
我已经编写了一个登录Facebook的基本测试。之后,我想编写另一个发布状态的测试用例。我想为此创建一个新的功能,但是如何在不重复整个登录过程的情况下做到这一点。在Junit中分离测试用例而不重复
@Test
public void Facebook_LoginTest() {
String title= null;
// And now use this to visit facebook
driver.get("http://www.facebook.com ");
// Find the text input element by its name
WebElement id = driver.findElement(By.id("email"));
WebElement password = driver.findElement(By.id("pass"));
WebElement login = driver.findElement(By.id("loginbutton"));
// Enter something to search for
id.sendKeys("[email protected]");
password.sendKeys("blahblahblah");