How to generate random Email- id in the Registration Pop-up page using Selenium IDE

By krithiga.m | 27th May 2015 | 2 min read

Selenium IDE is an Automation testing tool that provide Record/Playback tool for testing website. IDE stands for Integrated Development Environment. It is implemented as Firefox Add-On and allows recording, editing and debugging test. Suppose you have Drupal website where user can purchase ticket through online platform.

The site consist of Registration fields in the pop-up page. The Record and playback tool can't reproduce random email id during each execution of the test case. Therefore we need to add additional commands to perform the registration process.

Consider Registration Pop-up page consist of following fields

  • Email id
  • Password

First of all we need to start Recording and Enter valid data in the Registration page. Issue related to Email id will appear during execution of the test case. During each execution the value of Email id need to be changed in order to have a successful Execution.
For changing an Email id randomly during each execution, following code can be used.

storeEval Math.round (Math.random() * 1357) random
type id=email selenium${random}@domain.com
type id=password user0123


Here Selenium denotes local part of the email id and random denotes random number and multiply by 1357 and round the value to nearest integer number and that will be given to the email id. So that during each execution random email id will be generated.

Hope this article helps you to solve the issue related to generate random Email id in the Registration Pop-up Page.