“超時”表示如果單元測驗花費的時間超過指定的毫秒數,那么TestNG將會中止它并將其標記為失敗,
使用屬性 timeOut = 引數(1s*1000)
package com.lc.testngChaoShi; import org.testng.annotations.Test; public class testNG13 { @Test(timeOut = 5000) //5000 表示 5秒 public void testNG13_01() throws InterruptedException { Thread.sleep(6000); } }

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/234672.html
標籤:其他
上一篇:八、TestNG忽略測驗
下一篇:十、TestNG分組測驗
