예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
 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()
예제 #6
0
 def __init__(self, driver):
     self.driver = driver
     self.browser = Browser(self.driver)
     self.wait = Wait(self.driver)