python

[Python] Inheritance and adding variable. Page object example

# page object of Dashboard page. SitePAge - parent class
class SiteDashboardPage(SitePage):
    PAGE_TITLE = (By.CLASS_NAME, 'page-title')

    def __init__(self, browser):
        SitePage.__init__(self, browser)
        self.page_title = self.browser.find_element(*self.PAGE_TITLE).text
Was this helpful?