美文网首页
TestNG超时测试

TestNG超时测试

作者: Lutous | 来源:发表于2019-07-26 16:47 被阅读0次
@Test(timeOut = XXX) 指定超时时间,单位是毫秒
package com.janson;

import org.testng.annotations.Test;

public class TimeOutTest {

    @Test(timeOut = 3000) //毫秒
    public void testSuccess() throws InterruptedException{
        Thread.sleep(2000);
    }

    @Test(timeOut = 2000)
    public void testFailed() throws InterruptedException{
        Thread.sleep(3000);
    }
}

执行结果一条执行成功,一条执行失败
参考:https://www.cnblogs.com/janson071/p/10002914.html

相关文章

网友评论

      本文标题:TestNG超时测试

      本文链接:https://www.haomeiwen.com/subject/cpydrctx.html