Skip to main content

Python library provides page factory approach to implement page object model in selenium

Project description


  • A Page Factory is one way of implementing a Page Object Model. In order to support the Page Object pattern.
  • As in Java we are using @findBy, here we are declaring all web element in dictionary. Dictionary keys become WebElement or class member variable with having all extended WebElement methods.

Main Features

  • Initialise all the webElements declared in Point at a time.
  • All WebElements methods are re-define to add extra features. eg- click method extended to have explicit wait for element to be clickable.
  • Cent percent unittest coverage.


  pip install selenium-page-factory


Every Page in Page Object Model should have WebDriver object as class member as shown below

class PageClass(PageFactory):

    def __init__(self,driver):
        self.driver = driver

Custom WebElement Methods

  • set_text * get_text
  • clear_text * click_button
  • get_list_item_count * select_element_by_text
  • select_element_by_index * select_element_by_value
  • get_all_list_item * get_list_selected_item
  • hover * is_Checked
  • is_Enabled * getAttribute
  • element_to_be_clickable * invisibility_of_element_located
  • visibility_of_element_located * highlight (Optional)

Note: Every WebElement will be created after verifying it's Presence and visibility on Page at Run-Time.

Project Page

Project Documentation with Examples

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

selenium-page-factory-1.7.tar.gz (4.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page