title: Jira Test Automation Using Selenium WebAPI
body: <p>We recorded a test case to log into jira using Selenium IDE. And it was running correctly.BUT when it exported to java web driver(jUnit4), it did not worked and gave element not found error.</p>
  
  <p>The code is :</p>
  
  <pre><code>package newjiralogin;
  
  import java.util.concurrent.TimeUnit;
  
  import org.junit.*;
  
  import static org.junit.Assert.*;
  
  import org.openqa.selenium.*;
  
  import org.openqa.selenium.firefox.FirefoxDriver;
  
  
  public class NewJiraLogin {
  
    private WebDriver driver;
  
    private String baseUrl;
  
    private final StringBuffer verificationErrors = new StringBuffer();
  
  
    @Before
    public void setUp() throws Exception {
  
      driver = new FirefoxDriver();
  
      baseUrl = "http://jiratest/";
  
      driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
    }
  
    @Test
    public void testUntitled2() throws Exception {
  
      driver.get("http://jiratest");
  
      driver.findElement(By.id("login-form-username")).clear();
      driver.findElement(By.id("login-form-username")).sendKeys("saumlk");
      driver.findElement(By.id("login-form-password")).clear();
      driver.findElement(By.id("login-form-password")).sendKeys("saumlk");
      driver.findElement(By.id("login")).click();
    }
  
    @After
    public void tearDown() throws Exception {
  
      driver.quit();
      String verificationErrorString = verificationErrors.toString();
      if (!"".equals(verificationErrorString)) {
        fail(verificationErrorString);
      }
    }
  </code></pre>
  
  <p>The main Method class :</p>
  
  <pre><code>package newjiralogin;
  
  import org.junit.runner.JUnitCore;
  
  
  public class NewJiralogintest {
  
      public static void main(String[] args) throws Exception {                    
         JUnitCore.main("newjiralogin.NewJiraLogin");  
      }
  }
  </code></pre>