def input_element(self, driver, by, value, doc=''): log.logger.info('{0} - 页面元素:{1} 输入值 {2}'.format(doc, by, value)) try: element = wd.get_clickable_element(driver, by) element.send_keys(value) except: log.logger.error('{0} - 页面元素输入失败!!!'.format(doc)) raise
def click_element(self, driver, by, doc=''): #self.wait_eleVisible(way, doc) log.logger.info('{0} - 点击页面元素:{1}'.format(doc, by)) try: element = wd.get_clickable_element(driver, by) element.click() except: log.logger.error('点击页面元素:{0},失败!!!'.format(by)) raise