selenium

Selenium: How to test a website’s sign up form with a random email address

In the Selenium beginner series we'll solve problems that are commonly faced when automating web testing with Selenium. This post will explain how Selenium can be used to automatically test a website's sign up form using Webdriver's Java language bindings.

Challenge

The application under test makes sure users cannot sign up more than once with an email address. Because we want to be able to run the sign up test many times, we need to sign up with a unique email address in each test run.

Solution

We’ll implement a method that generates a unique email address every time the automated test case is run, thus making the test case repeatable.

Example code

How would you solve this?

If you haven’t yet, try out Usetrace – a codeless UI to Selenium.

Subscribe to our mailing list

* indicates required

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.