首页 > 其他 > 详细

TestNG超时测试

时间:2018-11-22 18:46:24      阅读:160      评论:0      收藏: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);
    }
}

上面的测试用例一条执行成功,一条执行失败

TestNG超时测试

原文:https://www.cnblogs.com/janson071/p/10002914.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!