7. Designing POM Classes in Python

POM in Python

class LoginPage:
    def __init__(self, driver):
        self.driver = driver
        self.login_btn = (By.ID, "login-btn")

def click_login(self):
self.driver.find_element(*self.login_btn).click()

Task

  • Unpack `*self.login_btn` inside `find_element`.
💡Common doubts
Did you like the problem?
Lesson 6 of 8
Python
Loading code editor…
Next