def macAddress() {
def rnd = new Random()
def mac = new StringBuilder()
(1..6).each {
int value = rnd.nextInt(256)
def hexStr = Integer.toHexString(value).padLeft(2, '0')
mac.append(hexStr)
if (it < 6) {
mac.append(':')
}
}
return mac.toString()
}
However "random" doesn't mean "unique" so it would be a good idea to pre-generate as many addresses as you will need somewhere in
setUp Thread Group, write them into a file and finally use
CSV Data Set Config in the "normal" Thread Group to read these pre-generated values.