51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 4446|回复: 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空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2010-6-17 16:12:12 | 只看该作者
JUnit3 has naming convention, which looks like "testXXXX". Other methods are regarded as normal methods instead of tests. Use Junit4 or TestNG + annotations to tackle it.
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2010-6-17 20:53:38 | 只看该作者
没看太明白。
你要的是不是testsuite呢?
回复 支持 反对

使用道具 举报

  • TA的每日心情
    开心
    2020-6-28 13:31
  • 签到天数: 4 天

    连续签到: 1 天

    [LV.2]测试排长

    4#
    发表于 2010-6-17 21:25:59 | 只看该作者
    原帖由 goal1860 于 2010-6-17 16:12 发表
    JUnit3 has naming convention, which looks like "testXXXX". Other methods are regarded as normal methods instead of tests. Use Junit4 or TestNG + annotations to tackle it.



    二楼正解  送花哈
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-5-2 06:08 , Processed in 0.069170 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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