Selenium-java-TestNg-的運行

來源:互聯網
上載者:User

標籤:public   accept   lips   set   imp   sof   software   name   單擊   

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測試結束都調用+瀏覽器關閉");
}
}

Selenium-java-TestNg-的運行

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.