jmeter-beanshell随机取数组一项


String[] wds = new String[] {"1280","1920","3840","666"};
String[] hgs = {"720","1080","2160","444"};

int index=(int)(Math.random()*wds.length);

String wd = wds[index];
String hg = hgs[index];

vars.put("wd",wd);
vars.put("hg",hg);

/*int[] wds = {1280,1920,3840,666};
int[] hgs = {720,1080,2160,444};

int index=(int)(Math.random()*wds.length);

int wd = wds[index];
int hg = hgs[index];
vars.putObject("wd",wd);
vars.putObject("hg",hg);*/

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM