예제 #1
0
 def locateElementByName(name):
     element = None
     try:
         element = AndroidTestDriver.initial().find_element_by_name(name)
         return True
     except Exception:
         logger.debug('Element with name %s cannot locate..' % name)
         getshots.getScreenShots()
         return False
     finally:
         return element
예제 #2
0
 def locateElementByXpath(xpath):
     element = None
     try:
         element = AndroidTestDriver.initial().find_element_by_xpath(xpath)
         return True
     except Exception:
         logger.debug('Element with xpath %s cannot locate..' % xpath)
         getshots.getScreenShots()
         return False
     finally:
         return element
예제 #3
0
 def locateElementsByClassName(classesName):
     element_list = None
     try:
         element_list = AndroidTestDriver.initial(
         ).find_elements_by_class_name(classesName)
         return True
     except Exception:
         logger.debug('Element list with className %s cannot locate..' %
                      classesName)
         getshots.getScreenShots()
         return False
     finally:
         return element_list
예제 #4
0
 def locateElementsByUiAutomator(uiautomators):
     element_list = None
     try:
         element_list = AndroidTestDriver.initial(
         ).find_elements_by_android_uiautomator(uiautomators)
         return True
     except Exception:
         logger.debug('Element list with uiautomator %s cannot locate..' %
                      uiautomators)
         getshots.getScreenShots()
         return False
     finally:
         return element_list
예제 #5
0
 def locateElementsById(elements_id):
     element_list = None
     try:
         element_list = AndroidTestDriver.initial().find_elements_by_id(
             elements_id)
         return True
     except Exception:
         logger.debug('Element list with id %s cannot locate..' %
                      elements_id)
         getshots.getScreenShots()
         return False
     finally:
         return element_list