def func_results(self, nature1, textOne, redirect, iframe1, nature2, textTwo): temp = True # 获取列表返回值task_id getDataId = getList(self.driver).get_list('mainFrame_45', 0, '//*[@id="table_content"]', 'tr', 'dataid') # 获取短信审核箱中提交过来的审核状态 time.sleep(12) self.click_element(sendpMms.msg_refresh, "短信审核箱_刷新") msg_checkTr = self.driver.find_element_by_css_selector('[dataid="' + str(getDataId) + '"]') msg_dispose = getProperty(self.driver).get_pro(msg_checkTr, 'handleStatusStr') if msg_dispose.text == '处理成功': msg_checkTrOne = getProperty(self.driver).get_pro( msg_checkTr, nature1) # 判断审核状态是否与预期一致 if msg_checkTrOne.text == textOne: self.driver.switch_to.default_content() # 释放iframe time.sleep(2) MenuUtils(self.driver).menu_tab('li', redirect) time.sleep(2) comm_frame(self.driver).Frame(iframe1) # 连接数据库循环判断已发短信是否有对应id Arr = connectMysql(self.driver).connect_mysql( '192.168.0.155', 'nemmp_common', "SELECT * FROM `mms_task_contact`", int(getDataId), 0) if len(Arr) > 0: for id in Arr: # 通过dataid属性定位元素 msg_alreadyTr = self.driver.find_element_by_css_selector( '[dataid="' + str(id) + '"]') # 获取属性为'sendStatus'的元素 msg_text = getProperty(self.driver).get_pro( msg_alreadyTr, nature2) msg_check = getProperty(self.driver).get_pro( msg_alreadyTr, 'statusCodeEn') # 判断发送状态与预期是否相符 if msg_check.text == '余额不足': print(msg_check.text) break elif textTwo != msg_text.text: print(msg_alreadyTr.text) print('状态代码' + msg_text.text) temp = False break else: print('找不到元素') temp = False else: print(msg_checkTrOne.text) temp = False else: print(msg_dispose.text) temp = False return temp
def func_results(self, nature1, textOne, redirect, iframe1, nature2, nature3, textTwo): temp = True # 获取列表返回值task_id getDataId = getList(self.driver).get_list('mainFrame_1878', 0, '//*[@id="table_content"]', 'tr', 'dataid') # 获取短信审核箱中提交过来的审核状态 time.sleep(24) self.click_element(videoMsgLoc.msg_refresh, "短信审核箱_刷新") msg_checkTr = self.driver.find_element_by_css_selector('[dataid="' + str(getDataId) + '"]') msg_dispose = getProperty(self.driver).get_pro(msg_checkTr, 'handleStatusStr') count = self.get_element_text(videoMsgLoc.videoMsg_count, "视频短信审核箱——列表条数") count = int(ced(self.driver).comm_extractDigital(count)) print(count) if count != 0: if msg_dispose.text == '处理成功': msg_checkTrOne = getProperty(self.driver).get_pro(msg_checkTr, nature1) # 判断审核状态是否与预期一致 if msg_checkTrOne.text == textOne: self.driver.switch_to.default_content() # 释放iframe time.sleep(2) MenuUtils(self.driver).menu_tab('li', redirect) time.sleep(2) comm_frame(self.driver).Frame(iframe1) # 连接数据库循环判断已发短信是否有对应id Arr = connectMysql(self.driver).connect_mysql('192.168.0.155', 'nemmp_common', "SELECT * FROM `video_sms_task_contact`", int(getDataId), 0) if len(Arr) > 0: for id in Arr: # 通过dataid属性定位元素 msg_alreadyTr = self.driver.find_element_by_css_selector('[dataid="' + str(id) + '"]') # 获取属性为'remark'的元素 msg_text = getProperty(self.driver).get_pro(msg_alreadyTr, nature2) # 获取属性为'statusCode'的元素 msg_remark = getProperty(self.driver).get_pro(msg_alreadyTr, nature3) # 判断发送状态与预期是否相符 if textTwo != msg_text.text: print(msg_alreadyTr.text) print(msg_text.text) print('状态代码:' + msg_remark) temp = False break else: print('找不到元素') temp = False else: print(msg_checkTrOne.text) temp = False else: print(msg_dispose.text) temp = False else: print('列表没有数据') temp = False return temp
def func_results(self, nature1, textOne, redirect, iframe1, nature2, nature3, textTwo): temp = True # 获取列表返回值task_id getDataId = getList(self.driver).get_list('mainFrame_106', 0, '//*[@id="table_content"]', 'tr', 'dataid') # 获取短信审核箱中提交过来的审核状态 time.sleep(60) # wait = WebDriverWait(driver, 20) self.click_element(sgeml.msg_refresh, "短信审核箱_刷新") msg_checkTr = self.driver.find_element_by_css_selector('[dataid="' + str(getDataId) + '"]') msg_dispose = getProperty(self.driver).get_pro(msg_checkTr, 'handleStatusStr') if msg_dispose.text == "处理完成": msg_checkTrOne = getProperty(self.driver).get_pro(msg_checkTr, nature1) # 判断审核状态是否与预期一致 if msg_checkTrOne.text == textOne: self.driver.switch_to.default_content() # 释放iframe time.sleep(2) MenuUtils(self.driver).menu_tab('li', redirect) time.sleep(2) comm_frame(self.driver).Frame(iframe1) time.sleep(20) self.click_element(sgeml.video_refresh, "短信审核箱_刷新") # 连接数据库循环判断已发短信是否有对应id Arr = connectMysql(self.driver).connect_mysql('192.168.0.155', 'nemmp_common', "SELECT * FROM `mail_task_contact`", int(getDataId), 0) if len(Arr) > 0: for id in Arr: # 通过dataid属性定位元素 msg_alreadyTr = self.driver.find_element_by_css_selector('[dataid="' + str(id) + '"]') # 获取属性为'returnMsg'的元素 msg_text = getProperty(self.driver).get_pro(msg_alreadyTr, nature2) msg_return = getProperty(self.driver).get_pro(msg_alreadyTr, nature3) # 判断发送状态与预期是否相符 if textTwo != msg_text.text: print(msg_alreadyTr.text) print('状态:' +msg_text.text) print('投递详情:' + msg_return.text) temp = False break else: print('找不到元素') temp = False else: print(msg_checkTrOne.text + '不等于入库成功(等待时间60s)') temp = False else: print(msg_dispose.text + '不等于处理完成') temp = False return temp
def func_checkResults(self, nature): # 获取列表返回值task_id getDataId = getList(self.driver).get_list('mainFrame_28', 0, '//*[@id="table_content"]', 'tr', 'dataid') # 获取短信审核箱中提交过来的审核状态 time.sleep(5) # 点击刷新按钮 self.click_element(sbml.msg_refresh, "短信审核箱_刷新") msg_checkTr = self.driver.find_element_by_css_selector('[dataid="' + str(getDataId) + '"]') msg_content = getProperty(self.driver).get_pro(msg_checkTr, 'sendContentStr') print(msg_content.text) print(msgDatas.birthday_success['content']) if msg_content.text == msgDatas.birthday_success['content']: msg_checkTrOne = getProperty(self.driver).get_pro(msg_checkTr, nature) else: print('短信审核箱里没有提交过来的生日短信任务') return msg_checkTrOne
def func_checkResults(self, nature): # 获取列表返回值task_id getDataId = getList(self.driver).get_list('mainFrame_45', 0, '//*[@id="table_content"]', 'tr', 'dataid') # 获取短信审核箱中提交过来的审核状态 time.sleep(2) msg_checkTr = self.driver.find_element_by_css_selector('[dataid="' + str(getDataId) + '"]') msg_checkTrOne = getProperty(self.driver).get_pro(msg_checkTr, nature) return msg_checkTrOne
def func_results(self, nature1, textOne, redirect, iframe1, nature2, nature3, nature4, textTwo, ): temp = True # 获取列表返回值task_id getDataId = getList(self.driver).get_list('mainFrame_28', 0, '//*[@id="table_content"]', 'tr', 'dataid') # 获取短信审核箱中提交过来的审核状态 time.sleep(12) self.click_element(sbml.msg_refresh, "短信审核箱_刷新") msg_checkTr = self.driver.find_element_by_css_selector('[dataid="' + str(getDataId) + '"]') msg_checkTrOne = getProperty(self.driver).get_pro(msg_checkTr, nature1) msg_dispose = getProperty(self.driver).get_pro(msg_checkTr, 'handleStatusStr') msg_content = getProperty(self.driver).get_pro(msg_checkTr, 'sendContentStr') print(msg_content) print(msgDatas.birthday_success['content']) if msg_content.text == msgDatas.birthday_success['content']: if msg_dispose.text == '处理成功': # 判断审核状态是否与预期一致 if msg_checkTrOne.text == textOne: self.driver.switch_to.default_content() # 释放iframe self.driver.implicitly_wait(5) MenuUtils(self.driver).menu_tab('li', redirect) self.driver.implicitly_wait(5) comm_frame(self.driver).Frame(iframe1) # 连接数据库循环判断已发短信是否有对应id Arr = connectMysql(self.driver).connect_mysql('192.168.0.152', 'nemmp_sms_zk', "SELECT * FROM `sms_task_birthday_contact`", int(getDataId), 0) if len(Arr) > 0: for id in Arr: # 通过dataid属性定位元素 msg_alreadyTr = self.driver.find_element_by_css_selector('[dataid="' + str(id) + '"]') # 获取属性为'sendStatus'的元素 msg_text = getProperty(self.driver).get_pro(msg_alreadyTr, nature2) # 获取属性为'statusCodeCh'的元素 msg_remark = getProperty(self.driver).get_pro(msg_alreadyTr, nature3) # 获取状态码信息 msg_status = getProperty(self.driver).get_pro(msg_alreadyTr, nature4) # 判断发送状态与预期是否相符 if textTwo != msg_text.text: print(msg_alreadyTr.text) print(msg_text.text) print('代码注释:' + msg_remark.text) print('状态代码'+msg_status) temp = False break else: print('找不到元素') temp = False else: print(msg_checkTrOne.text) temp = False else: print(msg_dispose.text) temp = False else: print('短信审核箱里没有提交过来的生日短信任务') temp = False return temp