title: My Test annotation not working, eclipse is asking for main method
body: <p>I have trying selenium code with @Test, but eclipse is not running it and asking for Main method.
  I've added Maven Project and added Selenium &amp; TestNG dependencies to pom.xml
  Please help with the issue I'm facing
  Sample code:</p>
  <pre><code>import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  import java.util.Properties;
  
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  import org.testng.annotations.Test;
  
  public class BaseTest {
      @Test
      public void openBrowser() {
          File file = new File(&quot;./src/test/resources/config.properties&quot;);
        
      FileInputStream fileInput = null;
      try {
          fileInput = new FileInputStream(file);
      } catch (FileNotFoundException e) {
          e.printStackTrace();
          System.out.println(&quot;File not found&quot;);
      }
      Properties prop = new Properties();
      
      //load properties file
      try {
          prop.load(fileInput);
      } catch (IOException e) {
          e.printStackTrace();
          System.out.println(&quot;Values not found&quot;);
      }
      System.setProperty(&quot;webdriver.chrome.driver&quot;,&quot;./src/test/resources/drivers/chromedriver.exe&quot;);
      WebDriver driver = new ChromeDriver();
      driver.get(prop.getProperty(&quot;baseURL&quot;));
  }
  </code></pre>
  <p>}</p>
  <p>On running it,I'm facing</p>
  <pre><code>Error: Main method not found in class com.digivalsolutions.digiassess.LoginTest, please define the main method as:
     public static void main(String[] args)
  or a JavaFX application class must extend javafx.application.Application
  </code></pre>
  <p>My pom.xml file:</p>
  <pre><code> &lt;dependencies&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;3.8.1&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
      &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
      &lt;version&gt;3.141.59&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.testng&lt;/groupId&gt;
      &lt;artifactId&gt;testng&lt;/artifactId&gt;
      &lt;version&gt;7.3.0&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>