title: Run Webdriver Junit browser specific test cases
body: <p>I have selenium.properties in which i specify the test configuration (baseURL, browser etc). This is used by ant script to kick off webdriver junit test cases. Now I have few junit test methods, that i want to run only on Firefox. I was wondering if there a way i can accomplish this using JUnit annotations? can i create custom annotations?</p>
  
  <pre><code>my setup
  
  public class TestBase{
      public static String baseURL = null;
      public static String browser = null;
  
      @BeforeClass
      public static void webdriverSetUp() {
  
          try {
  
              FileInputStream fn = new FileInputStream(SELENIUM_PROP_FILE);
              Properties selenium_properties = new Properties();
              selenium_properties.load(fn);                       
              baseURL = selenium_properties.getProperty("baseUrl");
              browser = selenium_properties.getProperty("browser");         
                } catch (Exception e) {
              e.printStackTrace();
          }
           if(browserg.equalsIgnoreCase("firefox")){
                  File profileDirectory = new File("./profile");              
                  FirefoxProfile profile = new FirefoxProfile(profileDirectory);
  
                  driver = new FirefoxDriver(profile);                
              }
  }
  
  //Test Class
  
      public class TestCase1 extends TestBase{
  
         @Test //run this case only if browser = firefox
         public void test1(){
         }
         @Test //do not run this case if browser = chrome
         public void test2(){
         }
      }
  any pointers?
  </code></pre>