Facebook にログインするための基本的なテストを作成しました。その後、ステータスを投稿する別のテスト ケースを書きたいと思います。そのための新しい関数を作成したいのですが、ログインプロセス全体を繰り返さずにそれを行うにはどうすればよいですか?
@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("id@blah.com");
password.sendKeys("blahblahblah");