美文网首页
验证toast

验证toast

作者: 水漾涟漪penny | 来源:发表于2019-10-29 18:05 被阅读0次

#encoding:utf-8

from find_element.capabilityimport driver

from selenium.webdriver.support.uiimport WebDriverWait

#启动APP 等待密码登录 进入短信登录页面

WebDriverWait(driver,3).until(lambda x:x.find_element_by_id("com.systoon.iningde:id/et_phone_num"))

driver.find_element_by_xpath("//*[@text='短信登录']").click()

#短信登录

driver.find_element_by_id("com.systoon.iningde:id/et_phone_num").clear()

driver.find_element_by_id("com.systoon.iningde:id/et_phone_num").send_keys("15313226821")

driver.find_element_by_xpath("//*[@text='获取验证码']").click()

driver.find_element_by_xpath("//*[@text='请输入验证码']").send_keys("1111")

driver.find_element_by_xpath("//*[@text='登录']").click()

# driver.find_element_by_xpath("登录").click()

#匹配toast

error_message="验证码错误,请重新输入"

limit_message="验证码错误次数超限,请在1小时后重试"

# message = "//*[@text=\'{}\']".format(error_message)

message ="//*[@text=\'{}\']".format(limit_message)

toast_message = WebDriverWait(driver,2).until(lambda x:x.find_element_by_xpath(message))

print(toast_message.text)

相关文章

  • 验证toast

    #encoding:utf-8 from find_element.capabilityimport driver...

  • Android 7.x Toast BadTokenExcept

    7.x版本,对Toast添加了Token验证,这本是对的,但是调用show()显示Toast时,如果有耗时操作卡住...

  • Android 7.x Toast BadTokenExcept

    7.x版本,对Toast添加了Token验证,这本是对的,但是调用show()显示Toast时,如果有耗时操作卡住...

  • Toast居中

    Toast toast = Toast.makeText(this, "居中位置的Toast", Toast.LE...

  • Toast报This Toast was not created

    Toast toast =new Toast(mContext);toast.setText("");//and...

  • 项目BaseActivity

    将公共部分提取 如:Toast,权限获取、验证、ButterKnife初始化、清理数据、弹框、顶部公共部分初始化、...

  • Toast源码查看记录

    Toast源码查看 Toast使用姿势 Toast.makeText(context,"提示内容", Toast....

  • toast vuejs

    components - toast - src - toast.vue components - toast -...

  • Android Toast提示

    默认显示:Toast toast = Toast.makeText(context, “hello”, time)...

  • 自定义Toast

    1.private void showToast(){ Toast toast = new Toast(this...

网友评论

      本文标题:验证toast

      本文链接:https://www.haomeiwen.com/subject/pzvgvctx.html