The “loop” could be done with a simple “for” statement, such as:
for (int icnt = 0; icnt < 10; icnt++) { }
The random factor can be done similar to the following:
The concern I see is what are the contents of the second drop-down. You may be able to set up your contents of drop-downs in a “case” blocks like the example in the sample, or just add a constant sum to the first random amount to get a second or even set up a second random function.
Random rand = new Random();
upperLimit = 10; // what are the number of items in the first drop-down
"do loop 10 times"
for (int icnt = 0; icnt < 10; icnt++) {
choice = rand.nextInt(upperLimit);
WebUI.selectOptionByValue(findTestObject('TO'), choice.toString(), false)
WebUI.waitForElementClickable(findTestObject('TO2')
WebUI.selectOptionByValue(findTestObject('TO2'), (choice + 1196).toString(), false)
}