1.试过properties→list,发现有中文字符的问题,只能用groovy自己写
import java.util.Random
//定义姓氏
def list = [“张”, “王”, “李”,‘马’,‘赵’]
//定义名字
def list1 = [“三”, “四”, “五”,‘六’,‘七’]
def random = new Random()
//在数组里取得一个随机数
def e=list.size()
def a = random.nextInt(e)
def b = random.nextInt(e)
def p= list[a]
def q= list1[b]
//jason字段传入,需要拼凑双引号拼凑,我加了单引号,有其他方法请告知我
def c=’"’
def n=c+p+q+c
soapUI随机姓名
最新推荐文章于 2022-07-19 09:49:26 发布