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
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
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
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
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