Raj Raj - 7 months ago 45
Java Question

how to create a random string of alphabets and get text

I am searching for methods to generate a string of alphabets and generate text to assert it, in selenium webDriver.
i am trying to create a customer with random name. however, I have to search for the newly created customer and click on the text to enter further info.


You can generate random alphanumeric number as :-

import java.util.UUID;

String uuid = UUID.randomUUID().toString();

//Now this uuid enter to your text box
driver.findElement(By.id("text box id")).sendKeys(uiid);