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?
Similar Posts
- [Python] Pytest fixture example with cleanup and teardown
- [Python] Simple yield generator example
- Assign multi-line string to a variable in python
- Python tip: How to insert a variable value inside a string
- Create or save object data in Django
- Create pandas DataFrame and add columns and rows to it
- [Python] The get() method on Python dicts and its "default" arg