TestNG(十二) 参数化测试

<?xml version="1.0" encoding="utf-8" ?>
<suite name = "parameter">
    <test name = "para">
        <parameter name = "name" value="zhangsan"/>
        <parameter name = "age" value="10"/>
        <classes>
            <class name = "com.course.testng.Parameter.ParameterTet"/>
        </classes>
    </test>
</suite>
package com.course.testng.Parameter;

import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class ParameterTet {
    @Test
    @Parameters({"name","age"})
    public void parameter(String name,int age){
        System.out.println();
        System.out.println("name = "+ name+";  age = "+age);
    }
}

 

 

posted @ 2019-08-26 12:00  怪圣卡杰  阅读(199)  评论(0编辑  收藏  举报