Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

selenium-page-factory

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selenium-page-factory

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

  • 2.7
  • PyPI
  • Socket score

Maintainers
1

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.
  • Added Selenium 4 support for ActionChains methods
  • Supports Selenium 4 ActionChains methods
  • Raised custom Page factory exceptions

Installation

  pip install selenium-page-factory

Pre-Requisite

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    	# Required
        self.timeout = 15      		#(Optional - Customise your explicit wait for every webElement,Default 10sec)
        self.highlight = True   	#(Optional - To highlight every webElement in PageClass)
		self.mobile_test = False    #(Optional - Added for Appium support)

Extended WebElements Methods

set_textget_text
clear_textclick_button
double_clickget_list_item_count
select_element_by_textselect_element_by_index
select_element_by_valueget_all_list_item
get_list_selected_itemhighlight
is_Enabledis_Checked
getAttributehover
visibility_of_element_locatedinvisibility_of_element_located
element_to_be_clickabletext_to_be_present_in_element
context_clickexecute_script
click_and_holdrelease
hover_with_offsetComing soon...

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

Project Page

https://github.com/NayakwadiS/selenium-page-factory

Documentation

https://selenium-page-factory.readthedocs.io

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc