Also can try this:
Random rand = new Random()
DBData listUsers = findTestData(‘katalonFolderPath/yourDataFile’)
int rowCount = listUsers.getRowNumbers()
rowNum= (rand.nextInt(rowCount - 1) + 1)
String firstName = listUsers.getValue(1, rowNum)
String lastName = listUsers.getValue(2, rowNum)
This will define two string variables you can pass into fields. It will always pick the two next to each other and randomized based upon size of your life. you can also comment them if you want to see what they are with.
WebUI.comment(firstName)
Or put them as a single value such as:
String firstName = listUsers.getValue(1, rowNum)
String lastName = listUsers.getValue(2, rowNum)
String userName = firstName + ’ ’ + lastName