Beispiel #1
0
 def element_is_exists(self,type,value):
    flag=True
    driver=ElementFinder().driver
    try:
        driver.find_element(type,value)
        return flag
    except:
        flag=False
        return flag
Beispiel #2
0
 def type(self, type, position, value):
     finder = ElementFinder()
     element = finder.find_element(type, position)
     if element != None:
         element.send_keys(value)
     else:
         print("No Find")
Beispiel #3
0
 def clickLonger(self, type, position):
     finder = ElementFinder()
     element = finder.find_element(type, position)
     if element != None:
         WebDriverEngine().runJs('window.scrollTo(0,' + element.location +
                                 ')')
         element.click()
         time.sleep(3)
Beispiel #4
0
 def ClickandHold(self,type,position):
     finder = ElementFinder()
     element = finder.find_element(type,position)
     if element!=None:
         # WebDriverEngine().runJs('window.scrollTo(0,'+element.location+')')
         # element.click()
         ActionChains(driver=ElementFinder().driver).click_and_hold(element)
         time.sleep(3)
Beispiel #5
0
 def isElementPresent(self, type, position):
     finder = ElementFinder()
     element = finder.find_element(type, position)
     logger.info('e.getMessage')
     if element != None:
         return True
     else:
         return False
Beispiel #6
0
 def getValue(self, type, position):
     finder = ElementFinder()
     return finder.find_element(type, position).get_attribute('value')
Beispiel #7
0
 def click(self, type, position):
     finder = ElementFinder()
     element = finder.find_element(type, position)
     if element != None:
         element.click()
         time.sleep(3)
Beispiel #8
0
 def ischecked(self, type, position):
     finder = ElementFinder()
     element = finder.find_element(type, position)
     return element.is_selected()
Beispiel #9
0
 def getText(self,type,position):
     finder = ElementFinder()
     element = finder.find_element(type, position).text.strip()
     print(element)
     return element
Beispiel #10
0
 def typeAndClear(self, type, position, value):
     finder = ElementFinder()
     element = finder.find_element(type, position)
     if finder:
         element.clear()
         element.send_keys(value)
Beispiel #11
0
 def rightClickMouse(self, type, position):
     driver = startBrowser()
     finder = ElementFinder()
     element = finder.find_element(type, position)
     ActionChains(driver).context_click(element).perform()
Beispiel #12
0
 def mouseoverElement(self, type, position):
     driver = startBrowser()
     finder = ElementFinder()
     element = finder.find_element(type, position)
     ActionChains(driver).move_to_element(element).perform()
Beispiel #13
0
 def getSelect(self, type, position):
     finder = ElementFinder()
     inputSelect = finder.find_element(type, position)
     return inputSelect
Beispiel #14
0
 def doubleClick(self,type,position):
     finder = ElementFinder()
     element = finder.find_element(type,position)
     if element!=None:
         ActionChains(ElementFinder().driver).double_click(element).perform()
         time.sleep(1.5)
Beispiel #15
0
 def getText(self, type, position):
     finder = ElementFinder()
     return finder.find_element(type, position).text().strip()
Beispiel #16
0
 def isDisplayed(self, type, position):
     finder = ElementFinder()
     element = finder.find_element(type, position)
     if element != None:
         print(element.is_displayed())
Beispiel #17
0
 def getSelect(self,type,position,value=None):
     finder = ElementFinder()
     element=finder.find_element(type,position)
     select=Select(element)
     return select