zoukankan      html  css  js  c++  java
  • selenium+python unittest实践过程之问题杂集

    1.列表选择项后直接获取文本内容获取不到,应该获取选择后显示的button的值

    2.取值后的值带有空格,可以使用.strip()删除前后空格,以便断言

    3.取值后有些值需要对类型进行转换才能断言成功

    4.对于checkbox以及分页的遍历遇到的问题

    每次勾选checkbox点击查询或者是点击页数按钮,页面都会刷新,webelement获取的元素过期,for循环的遍历失败

    报错:

    Error:
    selenium.common.exceptions.StaleElementReferenceException: Message: The element reference of <input> stale: either the element is no longer attached to the DOM or the page has been refreshed

    目前没有找到解决的方法,亟待大神帮忙

    5.使用sublime软件写代码,运行脚本后发现经常出现这个错误:

    unindent does not match any outer indentation level

    找了半天的错误最后才发现是空格缩进的问题:

    所以查看>缩进>使用空格缩进,这样就可以搞定了

    后期会继续记录遇到的问题......

  • 相关阅读:
    寒假作业3:简化电梯优化
    线段树2
    线段树1
    数字游戏(二)
    P1352 没有上司的舞会
    加分二叉树
    数字转换
    BLO-Blockade
    树上倍增法求LCA
    种西瓜
  • 原文地址:https://www.cnblogs.com/evablogs/p/7229471.html
Copyright © 2011-2022 走看看