-
Notifications
You must be signed in to change notification settings - Fork 5
Customization using Custom Fields and Profiles
While Fake Filler 2 comes with sensible defaults for most common use cases, you can customize the settings for your requirements. The two ways you can customize Fake Filler 2 is through custom fields and profiles.
Custom fields determine how Fake Filler 2 will generate dummy data for the input fields it finds on a page.
Fake Filler 2 can use the ID, NAME, CLASS, and PLACEHOLDER values of an input field in addition to the label text to determine its data type. Additionally, you can customize the list of attributes by adding your own to the Custom Attributes
field such as data
or testid
. You can determine what the extension will use to match input fields by changing the settings in the General section of the options page. You can adjust the search phrases in the Text Match and Regex Match fields to tweak how Fake Filler 2 determines the correct data type.
Basically, any partial match in the places with the word "match" below:
<label for="match"><match</label>
<input type="anything" id="match" name="match" class="match" />
When creating custom fields, and deciding what to put in the Match field, please note that:
- The fields are matched based on the order of the custom fields. Therefore, you should order your custom fields so that the most specific ones are at the top while the most generic ones are at the bottom.
- All punctuation is removed before being matched (e.g. user_name will become username). Therefore, if you have
<input type="text" name="user[1].first_name" />
as the input field, the extension will convert the name touserfirstname
- Attributes take precedence over any configuration and may override it in some cases, so
<input type="tel" name="first_name" />
will fill in a telephone - not a first name.
The following table describes the input types and the custom fields you can create to match those types:
Input Type | Custom Field Types |
---|---|
date |
Date |
email |
Email Address |
number |
Number |
range |
Number |
radio |
Randomized List |
tel |
Telephone, Regular Expression, Randomized List |
text |
All custom fields |
For example, consider a field <input type="tel" name="credit_card_number" />
on your page. You can create a Regular Expression or Randomized List custom field to generate dummy credit card numbers instead of a telephone number. All you need to do is make sure this custom field is ordered above one that is of type Telephone and Number!
Profiles allow you to create different custom fields for different sites. Fake Filler 2 comes with a Default
profile, which contains some default custom fields. This Default profile cannot be deleted and custom fields within this profile will be used if matching custom fields are not found in other profiles.
Profiles can be created from the Custom Fields page. A profile must have a regular expression that matches the URL of the page that the profile will apply to. When Fake Filler 2 finds a profile that matches the URL of the page on the current tab, the extension icon will have a gold star badge and the tooltip will show the name of the matching profile.
If more than one profile matches the URL of the current tab, then the first one will be used.