pom framework interview questions

Most frequently Asked Page Object Model(POM) Interview Questions
  • What is a Page Object Model?
  • What are the Advantages of Page Object Model?
  • How to implement POM?
  • Is Page object model a framework?
  • What is the Page Factory Class?
  • What is Page Factory?
  • Differences between Page Object Model and Page Factory?

Page Object Model Interview Questions and answer for Experienced Automation Tester

Page Object Model Interview Questions

  • What is a page object model?
  • What is a page object model in selenium?
  • Is Page object model a framework?
  • What is the Page Factory Class?
  • What is Page Factory?
  • What is the difference between Page Object Model (POM) and Page Factory?
  • What is Test Class?
  • What is Page Action Class?
  • What is Page Factory Class?
  • Can you write sample code for Page Factory Class?
  • Can you write sample code for Page Action Class?
  • What are the advantages of using page object pattern?
  • Ques11: Have you used Excel Sheet in your project? What are you using for the same?

    Ques18: What is POM (Page Object Model)? Is it some framework? What is it used for?

    This is the third post in the series of Selenium interview preparation. In case you missed first two posts below are the link.

    In most of the calendars which use date picker, month and year are generally in form of a drop-down and the dates are in some table. Sometimes directly using xpath works and sometimes you have to iterate over this table to select a date from the calendar.

    Ques9: Have you heard of Continuous Integration, Continuous Delivery, and Continuous Deployment? Which tool are you using for same?

    Explore our Popular Software Engineering Courses

    Q.4) What are the various exceptions in Selenium WebDriver?

    Just like any other programming language, you can find exceptions in Selenium as well. You can find the following exceptions in Selenium WebDriver:

    TimeoutException: You get this exception when a command does not perform an action in the specified time.

    NoSuchElementException: You get this exception when it cannot find an element with the given attributes on a web page.

    ElementNotVisibleException: You get this exception when an element is available in the document object model, but it is not seen on the web page.

    StaleElementException: You get this exception when an element is not attached to the document object model or is deleted.

    Q.5) Explain Selenium exception test

    The exception you expect to be thrown inside a test class is an exception test. If you write a test case intending it to throw an exception, you must use the @test annotation and also mention it in the parameters that which exception would be thrown. For instance,

    Q.6) Is there a need for an excel sheet in a project? Is yes, how?

    Excel sheets are used as a data source during testing. Further, it also stores the data set while executing data-driven testing. When excel sheets are used as a data source, it can store:

    Application URL: Developers can mention the environment URL under which the testing is executed. For example, testing environment, development environment, QA environment, production environment, or staging environment.

    User name and password information: Excel sheets can keep safe the access credentials like the username of a password of various environments. Developers can encrypt and store these details for security reasons.

    Test cases: Developers can make a table wherein one column write the test case name and the other which says to be executed or not.

    If you are going to use excel sheets for DataDriven Test, you can easily store the information for various duplications to be executed during the tests. For instance, all the data that needs to be written in a text box for testing on a web page can be stored in the excel sheets.

    upGrad’s Exclusive Software and Tech Webinar for you –

    SAAS Business – What is So Different?

    Q.7) What is POM? List its advantages?

    POM stands for Page Object Model. It is a design pattern for creating an Object Repository for web UI elements. Every single web page in the application must have its own corresponding page class, which is in charge of searching the WebElements in that page and then execute operations on them.

    The advantages of using the Page object model are:

  • It makes the code readable by letting developers separate operations and UI flows from verification.
  • Several tests can use the same Object Repository because it is independent of Test Cases.
  • The code becomes reusable.
  • Q.8) What is a Page Factory?

    Page Factory offers an enhanced method to execute the Page Object Model by efficiently using the memory, and the execution is done using object-oriented design.

    POM Implementation
    With Page Factory Without Page Factory
    Uses By() Uses @FindBy()
    No imports are required Imports Page factory
    No cache storage Cache lookup is faster

    Page Factory initializes the elements of the Page Object or instantiates the Page Objects itself. Annotations for elements can also be produced. It is, in fact, a better way as the describing properties may not be expressive enough to differentiate one object from another

    If POM is used without a page factory, instead of having to use ‘FindElements,’ @FindBy is used to look for WebElement, and initElements is used to initialize web elements from the Page Factory class.

    @FindBy can accept attributes like tagName, name, partialLinkText , linkText, id, className , css, and xpath.

    Q.9) How do you achieve synchronization in WebDriver? Or, tell us about the different types of wait statements Selenium Web Driver?

    You can find two wait statements in Selenium web driver, namely, Implicit Wait and Explicit Wait.

    Implicit wait commands the WebDriver to wait for a little by polling the DOM. It is present for the complete life of the web driver instance, once the implicit wait is declared. The pre-set value is zero. If you set it more than zero, then the behavior will poll the DOM on a regular basis based on the driver implementation.

    Explicit wait commands the execution to wait for a little till a condition is attained like:

    10) What is the use of JavaScriptExecutor?

    You can execute JavaScript through Selenium Websriver using JavaScriptExecutor. It is an interface that offers this mechanism. It gives methods like “executescript” and “executeAsyncScript” to run JavaScript in the condition of the currently chosen frame or window. An example of that is:

    JavascriptExecutor js = (JavascriptExecutor) driver;

    Explain what is Maven? How does it work?

    Maven is a project management tool. It provides the developer a complete build lifecycle framework. On executing Maven commands, it will look for POM file in Maven; it will run the command on the resources described in the POM.

    FAQ

    How do you explain poms in an interview?

    POM stands for Page Object Model. It is a design pattern for creating an Object Repository for web UI elements. Every single web page in the application must have its own corresponding page class, which is in charge of searching the WebElements in that page and then execute operations on them.

    How do you explain POM framework?

    Page Object Model, also known as POM, is a design pattern in Selenium that creates an object repository for storing all web elements. It is useful in reducing code duplication and improves test case maintenance. In Page Object Model, consider each web page of an application as a class file.

    Why do we use constructor in Pom?

    Note: A constructor has to be created in each of the class in the Page Layer, in order to get the driver instance from the Main class in Test Layer and also to initialize WebElements(Page Objects) declared in the page class using PageFactory.

    What are advantages of pom?

    The Page Object Model or POM is a design pattern used in Selenium WebDriver that creates an object repository for storing all the web elements. It is very useful when minimizing the code and removing redundancies. POM also assists QA teams when enhancing the reusability and efficiency of code.

    Related Posts

    Leave a Reply

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