We are using Random class to generate a Random number. which we are using in our random Email ID.
- emailTextBx.click();
- Random randomGenerator = new Random();
- int randomInt = randomGenerator.nextInt(1000);
- emailTextBx.sendKeys("username"+ randomInt +"@gmail.com");
The above code will generate a random number starting from 0 to 999., as we are giving the integer limit upto 1000.
Output: