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); } }
创作不易,转摘请标明出处。如果有意一起探讨测试相关技能可加博主QQ 771268289 博主微信:ding17121598
本文来自博客园,作者:怪圣卡杰,转载请注明原文链接:https://www.cnblogs.com/dwdw/p/11411736.html