I created a data file via excel sheet having 100 entries. I want to read a random value from the cell using random function. Please can someone help with the code.
Every time i run test case, random value to be input into the fields. See sample test data.
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
I think you will have to be more exacting on what your concern is with the code that @Arnel and @B_L have given above to do just that; select random value from an Excel sheet.