PageFactory - The code below throws - java.lang.NullPointerException.
Do I need to specifically initialize PageFactory, like shown below:
GoogleSearchPage page = PageFactory.initElements(driver, GoogleSearchPage.class);
If so, how, please let me know how to do that.
public class Test1Class
{
@FindBy(name="q")
private WebElement searchBox;
@Test
public void CreateDriverAndSetup()
throws Exception
{
try{
WebDriver driver = new FirefoxDriver();
driver.get("
http://www.google.com");
Thread.sleep(11);
searchBox.sendKeys("we");