def is_enabled(self, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY): try: Wait(self.driver).element_visible(self.locator, timeout, frequency) Browser(self.driver)._get_element(self.locator).is_enabled() return True except (TimeoutException, NoSuchElementException): return False
def get_attribute(self, attribute, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY): Wait(self.driver).element_present(self.locator, timeout, frequency) value = Browser(self.driver)._get_element( self.locator).get_attribute(attribute) return value
def get_size(self, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY): Wait(self.driver).element_clickable(self.locator, timeout, frequency) size = Browser(self.driver)._get_element(self.locator).size return size
def get_text(self, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY): Wait(self.driver).element_visible(self.locator, timeout, frequency) text = Browser(self.driver)._get_element(self.locator).text return text
def submit(self, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY): Wait(self.driver).element_clickable(self.locator, timeout, frequency) Browser(self.driver)._get_element(self.locator).submit()
def __init__(self, driver): self.driver = driver self.browser = Browser(self.driver) self.wait = Wait(self.driver)