I am using Selenium 2. But after running following code, i could not
You should replace WebDriver wb = new FirefoxDriver(); with driver = new FirefoxDriver(); in your @Before Annotation.
WebDriver wb = new FirefoxDriver();
driver = new FirefoxDriver();
@Before
As you are accessing driver object with null or you can make wb reference variable as global variable.
driver
wb