脚本
随机数 # 随机生成几位随机数 ${num} set variable 6 ${random} evaluate "".join(random.sample(string.letters+string.digits,int(${num}))) random,string # 随机生成一个字符串 ${ascii_letter} evaluate string.ascii_letters string ${ascoo_lowercase} evaluate string.ascii_lowercase string ${letters} evaluate string.letters string ${digits} evaluate string.digits string # 随机生成一个浮点数0.0~1.0之间 ${float} evaluate random.random() random # 随机生成一个范围内(下限,上限)的浮点数 ${rand_float} evaluate random.uniform(1.5,5.6) random # 随机生成一个范围内的整数 ${int} evaluate random.randint(0,10) random # 从序列中返回随机元素 ${seq} set variable ['130','133','187','159','180','177','150','156','aaa'] ${rand_item} evaluate random.choice(${seq}) random # 从序列找那个选择N个随机且独立的元素 ${rand_str} evaluate random.sample("0123456789",5) random,string ${rand_string} evaluate "".join(random.sample("0123456789",5)) random,string
输出