def toRepay(driver_forward): sleep(2) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.btn_loanApply_css.value).click() waitUntilClick(driver_forward, path_Tripartite_interaction.btn_repayment_css.value) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.btn_repayment_css.value).click() # 还款申请页面 logger.info('还款申请页面') waitUntilClick(driver_forward, path_Tripartite_interaction.btn_submitRepay_cs.value) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.input_repayBankName_css.value).send_keys( "工商银行") driver_forward.find_element_by_css_selector(path_Tripartite_interaction.input_repayBankNum_css.value).send_keys( "123456789012") picture_dir1 = os.getcwd() + '\\test_data\\picture\\id_1.jpg' driver_forward.find_element_by_css_selector(path_Tripartite_interaction.upload_repayPic_css.value).send_keys( picture_dir1) sleep(1) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.checkBox_repayAgree_css.value).click() driver_forward.find_element_by_css_selector(path_Tripartite_interaction.btn_submitRepay_cs.value).click() logger.info('还款申请提交完成页面') waitUntilDisplay(driver_forward, path_Tripartite_interaction.txt_RepayOk_cs.value) sleep(1) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.btn_myMain_css.value).click() sleep(1) driver_forward.quit()
def backStageLogin(driver, act, pwd, flag): driver.find_element_by_css_selector( path_backstage_examine.input_actLogin_css.value).send_keys(act) driver.find_element_by_css_selector( path_backstage_examine.input_actPwd_css.value).send_keys(pwd) driver.find_element_by_css_selector( path_backstage_examine.btn_login_css.value).click() if flag != 1: waitUntilDisplay(driver, path_backstage_examine.txt_backstage_css.value) else: waitUntilDisplay(driver, path_backStage_authentication.btn_codeAu_css.value) logger.info('成功登录后台系统')
def companyPassForget(driver, Act, Type): waitUntilClick(driver, path_backStage_authentication.btn_forPass_css.value) sleep(1) driver.find_element_by_css_selector( path_backStage_authentication.btn_forPass_css.value).click() waitUntilClick(driver, loginOn.btn_next_css.value) sleep(0.5) driver.find_element_by_css_selector( loginOn.input_actForget_css.value).send_keys(Act) driver.find_element_by_css_selector( loginOn.input_codeForget_css.value).send_keys(' ') waitUntilClick(driver, loginOn.btn_phoneCodeForget_css.value) sleep(0.5) flushDb() driver.find_element_by_css_selector( loginOn.btn_phoneCodeForget_css.value).click() while 1: if Type == 1: message = getPhoneMessage().get("actBank") else: message = getPhoneMessage().get("actRisk") if message is None: sleep(1) continue else: break message = message.strip().strip('"') el = driver.find_element_by_css_selector( loginOn.input_phoneCodeForget_css.value) el.send_keys(Keys.LEFT) el.send_keys(message) el.send_keys(Keys.DELETE) # 密码重置页面 waitUntilClick(driver, loginOn.btn_next_css.value) sleep(0.5) driver.find_element_by_css_selector(loginOn.btn_next_css.value).click() waitUntilDisplay(driver, loginOn.btn_nextPwd_css.value) logger.info("成功进入到密码重置页面") sleep(0.5) driver.find_element_by_css_selector( loginOn.input_pwdForget_css.value).send_keys('123456') driver.find_element_by_css_selector( loginOn.input_pwdConfirm_css.value).send_keys('123456') driver.find_element_by_css_selector(loginOn.btn_nextPwd_css.value).click() # 修改完成画面 sleep(2) logger.info("成功进入到密码修改完成页面")
def companyLoginOn(): def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) driver = webdriver.Chrome() driver.maximize_window() driver.get(url_forward) # 登陆页面 login(driver) # 首页 waitUntilDisplay(driver, loginOn.link_home_css.value) homeText = driver.find_element_by_css_selector(loginOn.link_home_css.value) test_Assert.assert_text_ui(homeText.text, '首页') logger.info("中小微企业金融服务聚合平台登录成功!") driver.quit()
def goToPay(driver_forward): sleep(3) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.btn_loanApply_css.value).click() waitUntilClick(driver_forward, path_Tripartite_interaction.select_productQuery_css.value) sleep(1) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.select_productQuery_css.value).click() waitUntilClick(driver_forward, path_Tripartite_interaction.btn_goToPay_css.value) sleep(0.5) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.btn_goToPay_css.value).click() sleep(1) logger.info('担保费缴费画面') waitUntilClick(driver_forward, path_Tripartite_interaction.btn_applyPay_css.value) picture_dir1 = os.getcwd() + '\\test_data\\picture\\id_6.png' driver_forward.find_element_by_css_selector(path_Tripartite_interaction.upload_payPicture_css.value).send_keys( picture_dir1) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.btn_applyPay_css.value).click() logger.info('担保费缴费完了画面') waitUntilDisplay(driver_forward, path_Tripartite_interaction.txt_applyPay_css.value) sleep(1) driver_forward.find_element_by_css_selector(path_Tripartite_interaction.btn_myMain_css.value).click()
def test_companyRegister(): if runMode == 'UI': def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) if jenkins: option = webdriver.ChromeOptions() option.add_argument('headless') # 浏览器不提供可视化页面 option.add_argument('no-sandbox') # 以最高权限运行 option.add_argument('--start-maximized') # 最大化运行(全屏窗口)设置元素定位比较准确 option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug option.add_argument('--window-size=1920,1080') # 设置浏览器分辨率(窗口大小) driver = webdriver.Chrome(options=option) else: driver = webdriver.Chrome(executable_path=driverPath) driver.maximize_window() driver.get(url_ui_register) # db中清除已注册的账户 deleteInforMobile() logger.info("对已注册的账户进行删除操作") sleep(1) waitUntilClick(driver, loginOn.btn_agree_css.value) driver.find_element_by_css_selector( loginOn.btn_agree_css.value).click() waitUntilDisplay(driver, loginOn.input_act_css.value) driver.find_element_by_css_selector( loginOn.input_act_css.value).send_keys(act) driver.find_element_by_css_selector( loginOn.input_pwd_css.value).send_keys(pwd) driver.find_element_by_css_selector( loginOn.input_conPwd_css.value).send_keys(pwd) waitUntilClick(driver, loginOn.btn_phoneCode_css.value) sleep(2) flushDb() driver.find_element_by_css_selector( loginOn.btn_phoneCode_css.value).click() while 1: message = getPhoneMessage().get("regMes") if message is None: sleep(0.5) continue else: break driver.find_element_by_css_selector( loginOn.input_phoneCode_css.value).send_keys( message.strip().strip('"')) waitUntilClick(driver, loginOn.btn_agreeReg.value) driver.find_element_by_css_selector(loginOn.btn_agreeReg.value).click() title = driver.title test_Assert.assert_text_ui(title, '中小微企业金融服务聚合平台') logger.info("注册成功,返回到登陆页面") sleep(1) driver.quit() else: # touch(Template(r"C:\Users\shaojunshuai\PycharmProjects\AutoTest-python\Auto_Test\test_data\picture\id_5.png")) logger.info("小程序自动化测试开始") startWeinxin() deleteInforMobile() # 删除个人信息 # clearCache() picture_dir1 = os.getcwd() + '\\test_data\\picture\\id_9.png' touch(Template(picture_dir1)) waiteForClick(mobileDriver(text='允许')) waiteForClick(mobileDriver(text='授权手机号')) waiteForClick(mobileDriver(text='允许')) # companyPassForgetForward(act) logger.info("小程序个人实名认证页面") # 上传身份证正反面 waiteForClick(mobileDriver(text='请上传身份证头像面')) waiteForClick(mobileDriver(text='所有图片')) waiteForClick(mobileDriver(text='自动化测试专用相册')) mobileDriver("android.widget.LinearLayout").offspring( "com.tencent.mm:id/dm6").child("com.tencent.mm:id/f4b")[3].child( "com.tencent.mm:id/dm0").click() waiteForClick(mobileDriver(text='完成')) sleep(3) waiteForClick(mobileDriver(text='请上传身份证国徽面')) waiteForClick(mobileDriver(text='所有图片')) waiteForClick(mobileDriver(text='自动化测试专用相册')) mobileDriver("android.widget.LinearLayout").offspring( "com.tencent.mm:id/dm6").child("com.tencent.mm:id/f4b")[2].child( "com.tencent.mm:id/dm8").click() waiteForClick(mobileDriver(text='完成')) sleep(1) waiteForClick(mobileDriver(text='提交认证')) # 活体认证欺诈性校验 getVerification() # 等待直到元素消失 while True: if mobileDriver(text='身份证有效期至').exists(): break else: continue picture_dir = os.getcwd() + '\\test_data\\picture\\id_6.png' touch(Template(picture_dir))
def test_businessInforReg(): if runMode == 'UI': def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) if jenkins: option = webdriver.ChromeOptions() option.add_argument('headless') # 浏览器不提供可视化页面 option.add_argument('no-sandbox') # 以最高权限运行 option.add_argument('--start-maximized') # 最大化运行(全屏窗口)设置元素定位比较准确 option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug option.add_argument('--window-size=1920,1080') # 设置浏览器分辨率(窗口大小) driver = webdriver.Chrome(options=option) else: driver = webdriver.Chrome(executable_path=driverPath) driver.maximize_window() driver.get(url_forward) # 登陆页面 login(driver) waitUntilDisplay(driver, path_businessInfoReg.txt_aut_css.value) txt_auTitle = driver.find_element_by_css_selector( path_businessInfoReg.txt_aut_css.value).text test_Assert.assert_text_ui(txt_auTitle, '企业基本资料') logger.info("企业基本资料画面正常显示") # 企业证件 el = driver.find_element_by_css_selector( path_businessInfoReg.input_companyName_css.value) el.send_keys('诚泰融资租赁(上海)有限公司') waitUntilDisplay_xpath(driver, path_businessInfoReg.display_name_xpath.value) el.send_keys(Keys.ENTER) sleep(1) driver.find_element_by_css_selector( path_businessInfoReg.input_legalIdCard_css.value).send_keys(idNum) driver.find_element_by_css_selector( path_businessInfoReg.input_legalPhone_css.value).send_keys( "17621198933") while True: try: driver.find_element_by_css_selector( path_businessInfoReg.sel_province_css.value).click() sleep(0.5) driver.find_element_by_xpath("//*[text() = '河北省']").click() break except: continue sleep(0.5) while True: try: driver.find_element_by_css_selector( path_businessInfoReg.sel_city_css.value).click() sleep(0.5) driver.find_element_by_xpath("//*[text() = '邯郸市']").click() break except: continue sleep(0.5) while True: try: driver.find_element_by_css_selector( path_businessInfoReg.sel_area_css.value).click() sleep(0.5) driver.find_element_by_xpath("//*[text() = '复兴区']").click() break except: continue sleep(1) driver.find_element_by_css_selector( path_businessInfoReg.input_contractAddress_css.value).send_keys( "金砖大厦10楼") driver.find_element_by_css_selector( path_businessInfoReg.input_legalPersonPostCode_css.value ).send_keys("200120") picture_dir = os.getcwd() + '\\test_data\\picture\\id_3.jpg' driver.find_element_by_css_selector( path_businessInfoReg.upload_legalPersonCertificate_css.value ).send_keys(picture_dir) # 生成随机银行号码 bankNO = random.randint(0, 99999999999999) driver.find_element_by_css_selector( path_businessInfoReg.upload_legalPersonBankNo_css.value).send_keys( str(bankNO)) sleep(0.5) while True: try: driver.find_element_by_css_selector( path_businessInfoReg.sel_bankName_css.value).click() sleep(0.5) driver.find_element_by_xpath( "/html/body/div[6]/div/div/div/div[2]/div[1]/div/div/div[3]" ).click() break except: continue sleep(0.5) while True: try: # 法定代表人信息 driver.find_element_by_css_selector( path_businessInfoReg.sel_country_css.value).click() sleep(1) driver.find_element_by_xpath( "/html/body/div[7]/div/div/div/div[2]/div[1]/div/div/div[2]" ).click() break except: continue sleep(0.5) picture_dir2 = os.getcwd() + '\\test_data\\picture\\id_1.jpg' picture_dir3 = os.getcwd() + '\\test_data\\picture\\id_2.jpg' picture_dir4 = os.getcwd() + '\\test_data\\picture\\id_4.jpg' driver.find_element_by_css_selector( path_businessInfoReg.sel_idCard1_css.value).send_keys(picture_dir2) driver.find_element_by_css_selector( path_businessInfoReg.sel_idCard2_css.value).send_keys(picture_dir3) # 实际控制人信息 sleep(1) driver.find_element_by_css_selector( path_businessInfoReg.radio_controlPerson_css.value).click() driver.find_element_by_css_selector( path_businessInfoReg.upload_controlPersonId1_css.value).send_keys( picture_dir2) driver.find_element_by_css_selector( path_businessInfoReg.upload_controlPersonId2_css.value).send_keys( picture_dir3) driver.find_element_by_css_selector( path_businessInfoReg.upload_controlPersonFamPic_css.value ).send_keys(picture_dir4) sleep(1) driver.find_element_by_css_selector( path_businessInfoReg.radio_legalPerson_css.value).click() waitUntilClick(driver, path_businessInfoReg.bth_submit_css.value) driver.find_element_by_css_selector( path_businessInfoReg.bth_submit_css.value).click() waitUntilDisplay(driver, path_businessInfoReg.text_atCof_css.value) txt_startAuTitle = driver.find_element_by_css_selector( path_businessInfoReg.text_atCof_css.value).text test_Assert.assert_text_ui(txt_startAuTitle, '请确认协议内容') logger.info("协议确认画面正常显示") waitUntilClick_xpath( driver, '//*[@id="root"]/div/div[2]/div/div[2]/div/div/div/div[1]/div/button' ) sleep(2) driver.find_element_by_xpath( path_businessInfoReg.checkBox_agree_xpath.value).click() waitUntilClick(driver, path_businessInfoReg.btn_Certification_css.value) driver.find_element_by_css_selector( path_businessInfoReg.btn_Certification_css.value).click() waitUntilDisplay(driver, path_businessInfoReg.text_atMid_css.value) txt_middleAuTitle = driver.find_element_by_css_selector( path_businessInfoReg.text_atMid_css.value).text test_Assert.assert_text_ui(txt_middleAuTitle, '认证中') logger.info("企业信息认证中画面正常显示") # 活体认证欺诈性校验 getVerification_ui(RequestURL, act) WebDriverWait(driver, 1200).until( EC.presence_of_element_located( (By.CSS_SELECTOR, path_businessInfoReg.text_bank_css.value))) driver.find_element_by_css_selector( path_businessInfoReg.input_moneyNum_css.value).send_keys('0.5') driver.find_element_by_css_selector( path_businessInfoReg.btn_middleCnf_css.value).click() sleep(3) waitUntilDisplay(driver, path_businessInfoReg.txt_examine_css.value) txt_examineAuTitle = driver.find_element_by_css_selector( path_businessInfoReg.txt_examine_css.value).text test_Assert.assert_text_ui(txt_examineAuTitle, '审核中') logger.info("企业信息审核中画面正常显示") driver.find_element_by_css_selector( path_businessInfoReg.btn_primary_css.value).click() # 登陆页面 waitUntilDisplay(driver, path_businessInfoReg.txt_aut_css.value) txt_auTitle = driver.find_element_by_css_selector( path_businessInfoReg.txt_aut_css.value).text test_Assert.assert_text_ui(txt_auTitle, '企业基本资料') logger.info("企业基本资料画面正常显示") driver.quit() else: logger.info('企业认证画面') waiteForClick(mobileDriver(text='我的')) waiteForClick(mobileDriver(text='企业认证')) sleep(1) waiteForClick(mobileDriver(text='*上传营业执照').parent().child()[2].child()) waiteForClick(mobileDriver(text='所有图片')) waiteForClick(mobileDriver(text='自动化测试专用相册')) mobileDriver("android.widget.LinearLayout").offspring( "com.tencent.mm:id/dm6").child("com.tencent.mm:id/f4b")[1].child( "com.tencent.mm:id/dm8").click() waiteForClick(mobileDriver(text='完成')) sleep(2) waiteForClick(mobileDriver(text='*邮政编码').parent().child()[2]) text("123456") mobileDriver(text='*邮政编码').click() mobileDriver(text='法人代表证件').drag_to(mobileDriver(text='企业证件照'), 0.5) waiteForClick( mobileDriver(text='*我是').parent().child()[2].child().child()) waiteForClick( mobileDriver(text='*法人代表归属地').parent().child()[2].child()) waiteForClick(mobileDriver(text='中国境内')) sleep(2) waiteForClick( mobileDriver(text='*实控人身份').parent().child()[2].child().child()) waiteForClick( mobileDriver(text='*实控人户口本主页').parent().child()[2].child()) waiteForClick(mobileDriver(text='所有图片')) waiteForClick(mobileDriver(text='自动化测试专用相册')) mobileDriver("android.widget.LinearLayout").offspring( "com.tencent.mm:id/dm6").child("com.tencent.mm:id/f4b")[0].child( "com.tencent.mm:id/dm8").click() waiteForClick(mobileDriver(text='完成')) sleep(2) waiteForClick( mobileDriver( text='*实控人婚姻状况').parent().child()[2].child().child()[1]) waiteForClick(mobileDriver(text='*对公银行账号').parent().child()[2]) bankNO = random.randint(0, 99999999999999) text(str(bankNO)) mobileDriver(text='*对公银行账号').click() waiteForClick( mobileDriver(text='*对公开户银行').parent().child()[2].child().child()) waiteForClick(mobileDriver(text='鞍山银行')) waiteForClick(mobileDriver(text='下一步')) logger.info('平台服务协议画面') waiteForClick(mobileDriver(text='我已阅读并同意')) waiteForClick(mobileDriver(text='请输入打款金额')) text('0.1') waiteForClick(mobileDriver(text='收到的金额')) waiteForClick(mobileDriver(text='确认提交')) sleep(3) waiteForClick(mobileDriver(name='com.tencent.mm:id/dc')) # 更改企业名称 updateNameCompany()
def test_backstage_examine(): def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) if jenkins: option = webdriver.ChromeOptions() option.add_argument('headless') # 浏览器不提供可视化页面 option.add_argument('no-sandbox') # 以最高权限运行 option.add_argument('--start-maximized') # 最大化运行(全屏窗口)设置元素定位比较准确 option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug option.add_argument('--window-size=1920,1080') # 设置浏览器分辨率(窗口大小) driver = webdriver.Chrome(options=option) else: driver = webdriver.Chrome(executable_path=driverPath) driver.maximize_window() driver.get(url_back) act = yamldict['test_backStageUserList']['company_user'] pwd = yamldict['test_backStageUserList']['company_user_pass'] # 登陆页面 backStageLogin(driver, act, pwd, 0) updateNameCompany() sleep(2) driver.find_element_by_xpath( path_backstage_examine.btn_bussMan_xpath.value).click() sleep(1) driver.find_element_by_xpath( path_backstage_examine.btn_bussList_xpath.value).click() sleep(1) elList = driver.find_elements_by_xpath( path_backstage_examine.btn_bussListName_xpath.value) index = 0 for i in range(len(elList)): path = path_backstage_examine.btn_bussListName_xpath.value + '[' + str( i + 1) + ']/' + 'td' + '[' + str(1) + ']' text = driver.find_element_by_xpath(path).text if text == businessName: index = i break bussPath = path_backstage_examine.btn_bussListName_xpath.value + '[' + str( index + 1) + ']' + '/td[8]' + '/span/a' driver.find_elements_by_xpath(bussPath)[0].click() sleep(0.5) waitUntilDisplay(driver, path_backstage_examine.txt_userInfor_css.value) userInforTxt = driver.find_element_by_css_selector( path_backstage_examine.txt_userInfor_css.value).text test_Assert.assert_text_ui(userInforTxt, "用户基本信息") logger.info('成功进入企业信息审核画面') driver.find_element_by_css_selector( path_backstage_examine.input_examine_css.value).send_keys('企业审核通过') driver.find_element_by_css_selector( path_backstage_examine.btn_code_css.value).click() while 1: message = getPhoneMessage().get("Audit") if message is None: sleep(0.5) continue else: break driver.find_element_by_css_selector( path_backstage_examine.input_code_css.value).send_keys( message.strip().strip('"')) driver.find_element_by_css_selector( path_backstage_examine.btn_examinePass_css.value).click() sleep(1) logger.info("企业认证通过") driver.quit()
def test_infoReg(): if runMode == 'UI': def_name = sys._getframe().f_code.co_name test_Assert = Assert.Assertions(def_name) logger.info("开始执行脚本%s:\n", def_name) # 对个人信息企业信息进行删除操作 deletePerInforAndComInfor() logger.info("对个人信息企业信息进行删除操作") if jenkins: option = webdriver.ChromeOptions() option.add_argument('headless') # 浏览器不提供可视化页面 option.add_argument('no-sandbox') # 以最高权限运行 option.add_argument('--start-maximized') # 最大化运行(全屏窗口)设置元素定位比较准确 option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug option.add_argument('--window-size=1920,1080') # 设置浏览器分辨率(窗口大小) driver = webdriver.Chrome(options=option) else: driver = webdriver.Chrome(executable_path=driverPath) driver.maximize_window() driver.get(url_forward) # 登陆页面 login(driver) waitUntilDisplay(driver, loginOn.link_home_css.value) sleep(1) homeText = driver.find_element_by_css_selector( loginOn.link_home_css.value) test_Assert.assert_text_ui(homeText.text, '首页') logger.info("进入登陆页面") name = yamldict['test_personalInfoRegList']['name'] idNum = yamldict['test_personalInfoRegList']['id_card'] BaseFunction.waitUntilClick(driver, path_personalInfoReg.btn_aut_css.value) picture_dir = os.getcwd() pcture_dirOne = '\\test_data\\picture\\id_1.jpg' pcture_dirTwo = '\\test_data\\picture\\id_2.jpg' driver.find_element_by_css_selector( path_personalInfoReg.file_idPicture1_css.value).send_keys( picture_dir + pcture_dirOne) BaseFunction.waitUntilDisplay( driver, path_personalInfoReg.btn_uplaodPicture1_css.value) driver.find_element_by_css_selector( path_personalInfoReg.file_idPicture2_css.value).send_keys( picture_dir + pcture_dirTwo) BaseFunction.waitUntilDisplay( driver, path_personalInfoReg.btn_uplaodPicture2_css.value) waitUntilClick(driver, path_personalInfoReg.btn_aut_css.value) sleep(3) driver.find_element_by_css_selector( path_personalInfoReg.btn_aut_css.value).click() getVerification_ui(RequestURL, act) BaseFunction.waitUntilDisplay( driver, path_personalInfoReg.txt_auting_css.value) text_auting = driver.find_element_by_css_selector( path_personalInfoReg.txt_auting_css.value).text test_Assert.assert_text_ui(text_auting, '认证中') logger.info("实名认证中画面显示") text_name_css = driver.find_element_by_css_selector( path_personalInfoReg.txt_name_css.value).text txt_idNum_css = driver.find_element_by_css_selector( path_personalInfoReg.txt_idNum_css.value).text text_phoneNum_css = driver.find_element_by_css_selector( path_personalInfoReg.txt_phoneNum_css.value).text test_Assert.assert_text_ui(text_name_css, name) test_Assert.assert_text_ui(txt_idNum_css, idNum) test_Assert.assert_text_ui(text_phoneNum_css, act) WebDriverWait(driver, 1200).until( EC.presence_of_element_located( (By.CSS_SELECTOR, path_personalInfoReg.txt_actSucess_css.value))) text_actSucess = driver.find_element_by_css_selector( path_personalInfoReg.txt_actSucess_css.value).text test_Assert.assert_text_ui(text_actSucess, "认证成功") logger.info("实名认证成功画面显示") driver.find_element_by_css_selector( path_personalInfoReg.btn_actInfor_css.value).click() titleText = driver.find_element_by_css_selector( path_personalInfoReg.txt_aut_css.value) test_Assert.assert_text_ui(titleText.text, '实名认证') logger.info("点击查看认证信息按钮,跳转到实名认证画面") driver.quit()