title: How to verify a page title using WebDriver and page object?
body: <p>I am trying to write a method to verify page title using page objects but I am unable to do it. Could you please help me out how to write a method to verify page title after searching something in the google page.</p>
  
  <p>Here is my 2 classes.</p>
  
  <h2>Class 1</h2>
  
  <pre><code>public class GoogleSearchPage {
  
  protected  WebDriver driver;
  
  
  @FindBy(name="q")
  private WebElement SearchBox;
  
  @FindBy(name="btnG")
  private WebElement SearchButton;    
  
  
  public void SearchFor(String SearchTerm)
  {
      SearchBox.sendKeys(SearchTerm);
      SearchButton.click();
  }   
  </code></pre>
  
  <p>}</p>
  
  <h2>Class2</h2>
  
  <pre><code> public class TestSearchResults {
  WebDriver driver;
  GoogleSearchPage page;
  
  @BeforeClass
  public void Launch() throws Exception
  {
      driver = new FirefoxDriver();
      driver.get("http://google.com");
  }
  
  @AfterClass
  public void Close()
  {
      driver.quit();
  }
  
  @Test
  public void ResultPage() {
      System.out.println(page);
      page=PageFactory.initElements(driver, GoogleSearchPage.class);
      page.SearchFor("selenium");
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Could you please help how to verify the title after displaying the Search results</p>
  
  <p>Note: I am using TestNG.</p>
  
  <p>Thanks in Advance,
  Shiva Oleti.</p>