51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 4484|回复: 3
打印 上一主题 下一主题

selenium如何在一个方法里面调用多个testcase

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-6-14 23:39:41 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
我已经写好了三个testcase,分别测试一个系统的三个功能,
现在我想再写一个testcase调用这三个测试类,该怎么实现呢?
我的代码如下,但是在junit里面执行的时候总提示junit.framework.AssertionFailedError: No tests found in seleniumtest1.autoreflashall
public class autoreflashall extends TestCase {
        protected void setUp() throws Exception {
                super.setUp();
        }
        public void autoreflashall() throws Exception{
                autoreflash  a0 = new autoreflash();
                autoreflash2 a1 = new autoreflash2();
                autoreflash3 a3 = new autoreflash3();
                autoreflash4 a4 = new autoreflash4();
                try{
                a0.setUp();
                a0.testfelash();
                a0.tearDown();
                }catch(InterruptedException e){
                        e.printStackTrace();
                }
                try{
                a1.setUp();
                a1.testfelash();
                a1.tearDown();
                }catch(InterruptedException e){
                        e.printStackTrace();
                }
                try{
                a3.setUp();
                a3.testfelash();
                a3.tearDown();
                }catch(InterruptedException e){
                        e.printStackTrace();
                }
                try{
                a4.setUp();
                a4.testfelash();
                a4.tearDown();
                }catch(InterruptedException e){
                        e.printStackTrace();
                }

               
        }
        
        protected void tearDown() throws Exception {
                super.tearDown();
        }

}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-16 04:33 , Processed in 0.065105 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表