Site Loader
Auckland, New Zealand

Post Author: Karthik kk

19 Replies to “Page Object Model (Page Navigation) in Selenium — Part 2”

  1. Part 4,5 and 6 videos are really useful, checked in youtube already, just curious to know if you have videos placed after part 6 to understand the rest of POM, thanks!

  2. Hi Karthik,

    Video uploaded in part 6 is same as part 5 and is repeated in this video series. Could you please sort this?


  3. I am getting the following error when running the code:

    My code is as follows:package excuteautomation.pom;

    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;

    public class GoogleHomePageObjects {

    // initialise anyobject in the page
    public GoogleHomePageObjects(WebDriver driver) {
    PageFactory.initElements(driver, this);


    public WebElement txtSearch;

    public WebElement btnSearch;


    package excuteautomation.pom;

    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;

    public class GoogleSearchTest {
    public static WebDriver driver = new FirefoxDriver();

    public static void main(String[] args) {

    //object for the page
    GoogleHomePageObjects page = new GoogleHomePageObjects(driver);
    // search for the text selenium


    // click the search button;



  4. Hi Karthik,

    I have a query related to video 6 in which we are returning a web page i.e. Selenium page.
    I am getting the below error message while I am executing the same code as in your video.

    Error : Exception in thread “main” java.lang.NullPointerException

      1. I have follow the Steps for static class but Error not get resolve
        Exception in thread “main” java.lang.NullPointerException

      2. Hi Karthik,

        i tried that method but still could not resolve the issue.Could you please explain how to resolve the null pointer exception issue?


        1. Not sure where the exception is happening, if you let us know the exact LOC of error, may be I can figure out. Since this code is working fine for years without any problem.

          Karthik KK

  5. In Video 7 when you executed the code, it seems that you have got the same error.

    Exception in thread “main” java.lang.NullPointerException
    org.pom.SeleniumPageObjects.ClickDownload( : 25)
    org.pom.GoogleSearchTest.main( : 32)

    Please help me out to resolve the error

  6. Hi Karthik,

    Your videos are of great help, but here both parts represent the same content. Can you pls check these two videos.


  7. I am not able to add static class as its showing error.Could you please let me know where the class needs to be added in order to resolve null pointer exception error.

  8. Did the NullPointException ever get resolved? I am seeing it at the ClickDownload()

    Exception in thread “main” java.lang.NullPointerException
    at com.sun.proxy.$ Source)
    at org.POM.SeleniumPageObjects.ClickDownload(
    at org.POM.GoogleSearchTest.main(

  9. Hi,

    Thanks for the wonderful clarity on POM concept!

    I wanted to know is there a way to implement Explicit wait or Fluent wait in POM concept?

    public class GoogleSearchText {

    public static WebDriver driver;

    public static void main(String[] args) throws InterruptedException {

    System.setProperty(“”, “D:\\Training\\Installation stuff\\Exe Files\\chromedriver.exe”);
    driver = new ChromeDriver();


    GoogleHomePageObjects page = new GoogleHomePageObjects(driver);



    SeleniumHomePageObject Sel = new SeleniumHomePageObject(driver);
    //Can v Add Explicit or Fluent wait for the below task, if yes how?

Leave a Reply

Your email address will not be published. Required fields are marked *