Пример #1
0
 def clickLonger(self,locator):
     finder = ElemFinder()
     element = finder.findElement(locator)
     if element!=None:
         ElemFinder().runJs('window.scrollTo(0,'+element.location+')')
         element.click()
         time.sleep(3)
Пример #2
0
 def isElementPresent(self,locator):
     finder = ElemFinder()
     try:
         element = finder.findElement(locator)
     except:
         logging.info('e.getMessage')
     if element!=None:
         return True
     else:
         return False
Пример #3
0
    def rightClickMouse(self,locator):
        finder = ElemFinder()
        element = finder.findElement(locator)
        ActionChains(self.driver).context_click(element).perform()



#**********************************************************************************
    # def selectByValue(self,locator,value):
    #     WebDriverEngine().getSelect(locator)
    #     time.sleep(5)
    # def selectByVisibleText(self,locator,value):
    #     WebDriverEngine().getSelect(locator)
    # def selectByIndex(self,locator,index):
    #     WebDriverEngine().getSelect(locator)
Пример #4
0
 def type(self, locator, value):
     finder = ElemFinder()
     element = finder.findElement(locator)
     if element != None:
         element.send_keys(value)
Пример #5
0
 def selectByIndex(self,locator,index):
     finder = ElemFinder()
     # select(finder.findElement(locator)).select_by_index(index)
     finder.findElement(locator).select_by_index(index)
     time.sleep(5)
Пример #6
0
 def selectByVisibleText(self,locator,value):
     finder = ElemFinder()
     select(finder.findElement(locator)).select_by_visible_text(value)
     time.sleep(5)
Пример #7
0
 def selectByValue(self,locator,value):
     finder=ElemFinder()
     select(finder.findElement(locator)).select_by_value(value)
     time.sleep(5)
Пример #8
0
 def getSelect(self,locator):
     finder = ElemFinder()
     inputSelect=select().select(finder.findElement(locator))
     # inputSelect=select(finder.findElement(locator))
     return inputSelect
Пример #9
0
 def getValue(self,locator):
     finder = ElemFinder()
     return finder.findElement(locator).get_attribute('value')
Пример #10
0
 def getText(self,locator):
     finder = ElemFinder()
     return finder.findElement(locator).text.strip()
Пример #11
0
 def isDisplayed(self,locator):
      finder = ElemFinder()
      element = finder.findElement(locator)
      if element!=None:
          print(element.is_displayed())
Пример #12
0
 def doubleClick(self,locator):
     finder = ElemFinder()
     element = finder.findElement(locator)
Пример #13
0
 def ischecked(self,locator):
     finder = ElemFinder()
     element = finder.findElement(locator)
     return element.is_selected()
Пример #14
0
 def click(self, locator):
     finder = ElemFinder()
     element = finder.findElement(locator)
     if element != None:
         element.click()
         time.sleep(3)