title: Generate random emails with Selenium
body: <p>How can I generate random emails using Selenium with Java?</p>
  <p>I was looking here in StackOverflow but I haven't found the answer to this.<br />
  I have tried with this, but it didn't help.</p>
  <pre class="lang-java prettyprint-override"><code>public class registerClass{
       
      public static void main(String[] args) {
      System.setProperty(&quot;webdriver.firefox.marionette&quot;,&quot;C:\\geckodriver.exe&quot;);
          WebDriver driver = new FirefoxDriver();
          
         String baseUrl = &quot; &quot;;
         
         driver.get(baseUrl);
         driver.manage().window().maximize();
         driver.findElement(By.id(&quot;cboxClose&quot;)).click();
         driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
         driver.findElement(By.id(&quot;login&quot;)).click();
         driver.findElement(By.xpath(&quot;/html/body/div[2]/div[1]/div/div[1]/div[2]/a[1]&quot;)).click();
         driver.findElement(By.id(&quot;register.firstName&quot;)).sendKeys(&quot;Karla&quot;);
         driver.findElement(By.id(&quot;register.paternalLastName&quot;)).sendKeys(&quot;Perez&quot;);
         driver.findElement(By.id(&quot;register.maternalLastName&quot;)).sendKeys(&quot;castro&quot;);
        
         driver.findElement(By.id(&quot;register.email&quot;)).sendKeys(&quot;castro9999@gmail.com&quot;);
       
         //driver.close();
         
      }
      
  }
  </code></pre>