I am new to Selenium WebDriver. I wrote the following piece of code using selenium/testNg and get a Java null pointer exception.
package in.bookscape;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
public class bookscape_langauge {
private WebDriver driver;
@Before
public void beforeTest()
{
driver = new FirefoxDriver();
}
@Test
public void test() throws InterruptedException{
driver.get("http://www.bookscape.in/");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
}
@After
public void afterTest()
{
driver.close();
driver.quit();
}
}
The error is pointing to the get sentence in the above code.