PhoneNumberFunctions Function Type


Phone Number Function Type in data generators allows you to generate valid phone numbers for testing applications, forms, or databases that require phone number fields. It helps ensure that they validate user interactions that require phone numbers.


Prerequisites

Before utilising the different data generator functions, it's essential to understand basic concepts such as creating Test Cases and Test Steps and adding data generators in test steps.


Selecting PhoneNumberFunctions as a Function Type for Data Generator

  1. Use NLP to create a new step in the test case and include a placeholder for test data.
  2. Click on the test data placeholder. From the Test Data Types dropdown menu, select the ! Data Generator option.
  3. On the ! Data Generators overlay screen, select the Type to Default. This will enable you to use a collection of built-in test data generators.
  4. Select PhoneNumberFunctions from the Function Type dropdown list. select phonenumberfunctions function type from data generators
NOTE:

This action will display a list of built-in functions associated with the PhoneNumberFunctions function type, enabling you to select the appropriate function based on your requirements.


Get OTP

  • Enables you to get an OTP for phone numbers matching a specified regular expression within a set timeout.
  • It is useful when you verify phone numbers during registration or login.
ℹ️Examples:
Input Output
Regex: \d{4}
Select Phone Number
Timeout: 30
1234
Regex: \d{6}
Select Phone Number
Timeout: 600
654321
Regex: \d{4,6}
Select Phone Number
Timeout: 120
4982, 789012
Regex: \d{5}
Select Phone Number
Timeout: 45
45178