Random Class
Random is the app's convenience object for human-like randomness and quick choices.
Random.delay(min, max)
Return a random delay value.
let result = Random.delay(1, 10);
console.log(result);Random.pointInRegion(x, y, w, h)
Return a random point inside a region.
let result = Random.pointInRegion(500, 1200, 300, 120);
console.log(result);Random.choice(array)
Pick one item from an array.
let result = Random.choice(['tap', 'wait', 'swipe']);
console.log(result);Random.range(min, max)
Random integer in a range (inclusive). Also available as the global function between(min, max).
let result = Random.range(1, 10);
console.log(result);Random.between(min, max)
Random integer in a range (inclusive). Also available as the global function between(min, max).
let result = Random.between(1, 10);
console.log(result);Example:
let p = Random.pointInRegion(100, 200, 120, 80);
click(p.x, p.y);