Raj Raj - 1 year ago 135
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.

Answer Source

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);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download