public class IndexInfo extends BaseTesting{
private IndexPage IndexPage1;
// private AddEquipmentInfoManagePage AddEquipmentInfoManagePage1;

protected static final Log log = LogFactory.getLog(IndexPage.class);
@BeforeClass
public void beforeClass() throws Exception {
init(Constants.USER_ADMIN, Constants.PASSWD_ADMIN);
IndexPage1=new IndexPage(driver);
}

@AfterTest
public static void tearDownAfterClass() throws Exception {
if(driver != null)
{
driver.quit();
System.out.println("运行结束");

}
}
@Test(dataProvider = "csvtestLogin1")
public void testLogin1(String case_num,String username,String password,String msg,String info) throws InterruptedException{
{

System.out.println("方法1");

}

@Test(dataProvider = "csvtestLogin2")
public void testLogin2(String case_num,String username,String password,String msg,String info) throws InterruptedException{
{

System.out.println("方法2");

}

配置testng.xml文件;

<?xml version="1.0" encoding="UTF-8"?>
<suite name="Suite" parallel="false">
  <test name="Demo"  >
    <classes>
      <class name="com.sa.test.IndexInfo">
          <methods preserve-order="true">
              <include name="testLogin1"/>
              <include name="testLogin2"/>          
          </methods>
      </class>
    </classes>
  </test>
</suite>

TestNG中同一个类中执行多个test()方法如何配置testng.xml的更多相关文章

  1. Java中同一个类中不同的synchronized方法是否可以并发执行?

    答案是: 不可以,因为都是获取到对象本身的锁. 多个线程访问同一个类的synchronized方法时, 都是串行执行的 ! 就算有多个cpu也不例外 ! synchronized方法使用了类java的 ...

  2. 《同一个类中不同方法之间的调用相关问题(省略的类名或者this)》

    //同一个类中不同方法之间的调用相关问题(省略的类名或者this) class A { public void B() { System.out.println("b方法运行"); ...

  3. 在同一个类中,一个方法调用另外一个有注解(比如@Async,@Transational)的方法,注解失效的原因和解决方法

    参考原贴地址:https://blog.csdn.net/clementad/article/details/47339519 在同一个类中,一个方法调用另外一个有注解(比如@Async,@Trans ...

  4. 【转】在同一个类中,一个方法调用另外一个有注解(比如@Async,@Transational)的方法,注解失效的原因和解决方法

    参考 原文链接 @Transactional does not work on method level 描述 在同一个类中,一个方法调用另外一个有注解(比如@Async,@Transational) ...

  5. @Transactional 同一个类中无事务方法a()内部调用有事务方法b()的问题

    https://blog.csdn.net/u010235716/article/details/90171802 1. 事务的4种特性       序号 参数 含义1 原子性(Atomicity) ...

  6. SpringCache @Cacheable 在同一个类中调用方法,导致缓存不生效的问题及解决办法

    由于项目需要使用SpringCache来做一点缓存,但自己之前没有使用过(其实是没有听过)SpringCache,于是,必须先学习之. 在网上找到一篇文章,比较好,就先学习了,地址是: https:/ ...

  7. 梳理:python—同一个类中的方法调用

    为什么突然在此提到这个梳理问题呢? 因为在自己实践综合练习学过的知识时,突然觉得有些知识点的运用总是不成功,于是翻过课本进行回顾,总是觉得是对的,可是当再进一步思考“既然是对的,为什么在程序中总是不成 ...

  8. java中方法内可以调用同一个类中的方法

    在同一个类中,java的普通方法的相互调用,可以使用this+点号+方法名,也可省略this+点号,java编 译器会自动补上.

  9. Spring事务:调用同一个类中的方法

    问题: 如果同一个类中有方法:methodA(); methodB().methodA()没有开启事务,methodB()开启了事务 且methodA()会调用methodB(). 那么,method ...

随机推荐

  1. Phalanx--hdu2859(dp 最大对称子图)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2859 题意就是给你一个n*n的字符矩阵,从中选出一个最大的子矩阵(m*m)满足关于斜对角线(左下角到右 ...

  2. 275. H-Index II

    题目: Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optim ...

  3. Docker基础技术:DeviceMapper

    在上一篇介绍AUFS的文章中,大家可以看到,Docker的分层镜像是怎么通过UnionFS这种文件系统做到的,但是,因为Docker首选的AUFS并不在Linux的内核主干里,所以,对于非Ubuntu ...

  4. 格子布局 js

    <!doctype html> <html> <head> <meta charset="UTF-8" /> <title&g ...

  5. 解决Hibernate Write operations are not allowed in read-only mode的方法

    错误信息: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed i ...

  6. 《c程序设计语言》读书笔记--大写转小写

    #include <stdio.h> #include <stdlib.h> #include <string.h> int aoti(char c) { if(c ...

  7. 自动化测试之python安装

    1.首先访问http://www.python.org/download/去下载最新的python版本. 2.安装下载包,一路next. 3.为计算机添加安装目录搭到环境变量,如图把python的安装 ...

  8. NDK(7)NDK debugging without root access

    from : http://ian-ni-lewis.blogspot.com/2011/05/ndk-debugging-without-root-access.html NDK debugging ...

  9. How to: Read Object Data from an XML File

    This example reads object data that was previously written to an XML file using the XmlSerializer cl ...

  10. MFC弹出菜单隐藏解决

    http://social.msdn.microsoft.com/Forums/en-US/5482103e-272b-4c9f-bac4-be15f14782bd/cmfcmenubar-remov ...