Hi Community.
Need your help in generating below two Outputs:
- Need a Unique Bank NickName everytime for entering Data in a Bank Account.
- Need a Unique Insured Name with CurrentDateTimeStamp.
Please advise.
Hi Community.
Need your help in generating below two Outputs:
Please advise.
hey @dsingh1 you can use faker
for that kind of problem
Faker faker = new Faker();
String tenRandomNumber = faker.number().digits(10)
String firstNameRandom = faker.name().firstName()
Does it requires any library to imported?
If you are missing import statement, then try CTRL + SHIFT + O (oh) to adjust your import statements to include those you are missing and remove those you do not need.
import com.github.javafaker.Faker
or, for random, I use:
import java.util.Random
Random rand = new Random();
upperLimit = WebUI.getNumberOfTotalOption(findTestObject('myPage/select_AssignedTo'));
choice = rand.nextInt(upperLimit)
WebUI.selectOptionByIndex(findTestObject('myPage/select_AssignedTo'), "${choice}")
WebUI.verifyOptionSelectedByIndex(findTestObject('myPage/input_AssignedTo'), "${choice}", 10)
but there is also:
import org.apache.commons.lang.RandomStringUtils as RandStr
Possibly you want “fake data”, not “Nick Name”.
Possibly you want this library :
Download the jar from https://mvnrepository.com/artifact/com.github.javafaker/javafaker/1.0.2
Save it into the Drivers
folder of your project
Close/reopen your project.
Thanks @kazurayam