title: Making executable file in Selenium WebDriver with Java
body: <p>Is it possible to make Selenium WebDriver executable file in java?
  I have written code in java for data driven testing using Selenium WebDriver. I want to make it executable file so that outside eclipse one can execute it.</p>
  
  <pre><code>package pkg;
  
  import java.util.concurrent.TimeUnit;
  
  import org.junit.After;
  import org.junit.Before;
  import org.junit.Test;
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  
  public class LogingS {
    private WebDriver driver;
    private String baseUrl;
  
    @Before
    public void setUp() throws Exception {
      driver = new FirefoxDriver();
      baseUrl = "http://www.example.com/";
      driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    }
  
    @Test
    public void testLogingS() throws Exception {
      driver.get(baseUrl);
      System.out.println("The current Url: " + driver.getCurrentUrl());
      driver.findElement(By.id("id_email")).clear();
      driver.findElement(By.id("id_email")).sendKeys("com");
      Thread.sleep(1000);
      driver.findElement(By.id("id_password")).clear();
      driver.findElement(By.id("id_password")).sendKeys("123");
      Thread.sleep(1000);
      System.out.println("The current Url: " + driver.getCurrentUrl());
      driver.findElement(By.id("btn_login")).submit();
      Thread.sleep(5000);
      System.out.println("The current Url: " + driver.getCurrentUrl());
  
    }
  
    @After
    public void tearDown() throws Exception {
  
    }
  }
  </code></pre>