zoukankan      html  css  js  c++  java
  • selenium_base_page在测试框架中的使用详解

    1、selenium_base_page是干什么的

    selenium_base_page 是继承了unittest.TestCase,重写了setup、teardown方法的类。

    2、为什么要使用selenium_base_page类

    因为每个测试模块的setup、teardown、大同小异,如果没有selenium_base_page,那么每个测试模块都要继承unittest.TestCase,都要重写setup、teardown,内容都差不多,代码就比较冗余

    而有了selenium_base_page,测试模块只要继承selenium_base_page即可,测试模块中无需再写重写setup、teardown,而每个测试模块如果有独有的setup需要重写也是可以实现的,在测试模块的setup方法中先使用super().setup(),使用父类的setup,然后在继续写该模块特有的内容即可。

  • 相关阅读:
    API
    API
    for in
    event flow
    object
    Report of program history
    正则表达式
    伪类与伪元素
    Position
    js学习之原型(补充)
  • 原文地址:https://www.cnblogs.com/lvhuayan/p/12870373.html
Copyright © 2011-2022 走看看