How to add random numbers to your code?
I have used this but it throws an error.
import org.apache.commons.lang.RandomStringUtils as RandStr
Random rand = new Random ();
upperLimit = 9999999
icnt = rand.nextInt(upperLimit);
WebUI.setText(findTestObject(Object Repository/Page_/input_acc_account_acc_num), icnt)
When you say it throws an error, it would be good if you mentioned what error it threw. It likely was MissingMethodException because you have an Integer instead of a String as the second parameter. You should change the statement to:
WebUI.setText(findTestObject('Page_/input_acc_account_acc_num'), icnt.toString())
1 Like