zoukankan      html  css  js  c++  java
  • Selenium-java-TestNg-的运行

    package com.day.www;

    import org.testng.annotations.AfterClass;
    import org.testng.annotations.AfterMethod;
    import org.testng.annotations.BeforeClass;
    import org.testng.annotations.BeforeMethod;
    import org.testng.annotations.Test;

    /*
    * 使用Testng之前需加载插件。方法如下:
    * 启动Eclipse,选择“Install New Software”
    * 单击“Add”Name:TestNG、
    * location:http://beust.com/eclipse
    * 填写完毕,然后点击“OK”
    * 选择“Select All”和“TestNG”,点击“Next”继续
    * 勾选“Accept the License Agreement”,然后单击“Finish”
    * 后面一直同意就可以了
    * 安装完成才能运行使用
    */

    public class day_test {
    @BeforeClass
    public void befo(){
    System.out.println("Befor运行测试都调用 +做浏览器初始化 ");
    }
    @BeforeMethod
    public void setup(){

    System.out.println("BeforeMethod+每次运行测试都调用 ");
    }
    @Test
    public void test1() {
    System.out.println("测试用例1");

    }
    @Test
    public void test2() {
    System.out.println("测试用例2");
    }
    @AfterMethod
    public void teardo(){
    System.out.println("AfterMethod+每次运行测试结束都调用");
    }
    @AfterClass
    public void afte(){
    System.out.println("Afte测试结束都调用+浏览器关闭");
    }
    }

  • 相关阅读:
    《仔仔细细分析Ext》 第N2章 GridPanel的小难点 第一节 每条数据后面跟随几个操作按钮
    TextField输入验证
    Ext.FormPanel 及控件横排显示
    备份
    重写
    this关键字
    TestCircle程序分析
    java方法重载
    static关键字
    super关键字
  • 原文地址:https://www.cnblogs.com/hs22/p/6016898.html
Copyright © 2011-2022 走看看