zoukankan      html  css  js  c++  java
  • UI自动化框架——构建思维

    目的:从Excel中获取列的值,传输到页面

    技巧:尽可能的提高方法的重用率

    Java包:

       1.java.core包

        3个类:1)日志(LogEventListener)扩展web driver自带的事件监听器

            2)时间等待,浏览器打开、关闭(BasicCase):BasicCase类中包含一个静态内部类DriverManager(用于new webDriver,赋值webDriver路径)

            3) 页面对象,用于初始化页面(BasicPage)

      2.java.core.page包

        继承BasicPage类:1)HomePage类:get(url)、可重用模块[对象(类)]  DriverManager.getDriver().get(URL)获取首页路径

                 2)otherPage:@FindBy(xpath:"****") [一个页面的所有元素or单个元素]

                  @FindBy(name = "leftFrame")
                    WebElement leftFrame;

      3.java.core.page.module包

        继承BasicPage类:1) Module类:@FindBy [模块操作方法]

                 2)App类:定义、读取Excel中对应cell的数据,传送给页面

    test包:

      1.test包:WebdriverEnv:测试开发环境是否搭建成功,与浏览器webDriver是否兼容,是否能打开浏览器

      2.testcases包:

        继承BasicCase:1) @Test(dataProvider="***") 开始run的

                2) @dataProvider(name="***",parallel=true)  [parallel=true,表示支持并发]

  • 相关阅读:
    hdu 1199 Color the Ball 离散线段树
    poj 2623 Sequence Median 堆的灵活运用
    hdu 2251 Dungeon Master bfs
    HDU 1166 敌兵布阵 线段树
    UVALive 4426 Blast the Enemy! 计算几何求重心
    UVALive 4425 Another Brick in the Wall 暴力
    UVALive 4423 String LD 暴力
    UVALive 4872 Underground Cables 最小生成树
    UVALive 4870 Roller Coaster 01背包
    UVALive 4869 Profits DP
  • 原文地址:https://www.cnblogs.com/shadow-yin/p/9839060.html
Copyright © 2011-2022 走看看