• ARTICLE
  • STRING
  • CONVERTER
  • ENCRYPT
  • NETWORK
  • MORE
    CHART
    MATH
    COORDINATE
    IMAGE
    FILE
  • ARTICLE
    STRING
    CONVERTER
    ENCRYPT
    NETWORK
    MORE
    CHART
    MATH
    COORDINATE
    IMAGE
    FILE
logo Online Tools
0 Comments Favorite Copy Link Share

Random Test Data Generator Online


Random Test Data Generator Online-summary

Online random test data generation tool, input string templates, use fakerjs and custom functions to generate random data. The randomly generated data supports multiple formats such as string, JSON, CSV, and the generated results can be downloaded locally.

Random Test Data Generator Online-instructions

Online random test data generation tool, using faker.js and custom functions of this tool to generate random test data. The generated data format supports raw strings, JSON format, CSV format, etc. The generated test data results support one click copy and download.

  1. This tool has a certain frequency limit, please use this tool reasonably. Anonymous : 30/IP*Hour, Normal user : 30/Hour, VIP : 720/Hour, Senior VIP : 720/Hour.
  2. The support for JavaScript syntax in this tool is constantly improving. If you have any problems using it, please feel free to leave a comment or email feedback.
  3. Generate Template : The template used to generate random test data supports calling the faker.js data generation method and the custom data generation method of this tool. ${ is the start flag of the template field, }$ is the end flag of the template field. If you need to use ${ original string, it needs to be represented as \${ , if you need to use }$ original string needs to be represented as \}$ . The template syntax is explained as follows:
    Type Category Syntax Description
    faker complete syntax ${ invokeChain.setResultType('resultTypeString') }$ Used for complex call scenarios.
    1. invokeChain:The invoke chain for method or property access. Support starting with faker and using methods or properties of faker instances. Starting with lddgo, use the methods or properties of accessing lddgo instances. It also supports the form of faker_locale to use a new faker instance for the region. For example, faker_en_HK generates this field using the faker instance in the English Hong Kong region.
    2. setResultType:Optional method calls, setting the format for the results, specified by the resultTypeString. The default result type is jsraw.
    3. resultTypeString : Indicates how to format the return value after the final call. The possible value is raw - the raw result. jsonraw - Simple types use raw results, while complex types use JSON serialization. json - Serialized as a JSON string. jsoncsv - Arrays can only be used in this way. Convert array format to CSV format. Simple types in arrays use the original results, while complex objects are serialized using JSON. jsraw - default result type, simple types use the original result, complex types use JSON serialization, and serialized JSON keys do not have double quotes. js - Serialized as a JSON string, the serialized JSON key does not have double quotes. jscsv - Arrays can only be used in this way. Convert array format to CSV format. Simple types in arrays use the original results, complex objects use JSON serialization, and serialized JSON keys do not have double quotes.
    faker 1 parameter ${ faker.number.int({ min: 10, max: 100000 }) }$ Invoke faker.number.int({ min: 10, max: 100000 }) to generate random integer between 10 and 100000.
    faker 0 parameter ${ faker.image.avatar() }$ Invoke faker.image.avatar() to generate random avatar.
    faker 2 parameters ${ faker.string.fromCharacters('abc', 10) }$ Invoke faker.string.fromCharacters('abc', 10) to generate random string.
    faker result type ${ faker.color.cmyk({ format: 'decimal' }).setResultType('jsoncsv') }$ Invoke faker.color.cmyk({ format: 'decimal' }) to generate random color, and set result type jsoncsv .
    faker array access ${ faker.color.cmyk({ format: 'decimal' })[0] }$ Invoke faker.color.cmyk({ format: 'decimal' }) to generate random color array, And obtain the first value in the array.
    lddgo 1 parameter ${ lddgo.number.intSequence({start:0,step:1,type:'asc',paddingZero:true}) }$ Invoke lddgo.number.intSequence({start:0,step:1,type:'asc',paddingZero:true}) to generate an increasing sequence of integers, with the sequence numbers aligned with the prefix 0.
    lddgo property access ${ lddgo.person.chnId({areaName:'上海市,上海市辖区,浦东新区',male:true}).id }$ Invoke lddgo.person.chnId({areaName:'上海市,上海市辖区,浦东新区',male:true}) to generate random chinese id card number, and use id property.
  4. Template : Select a predefined sample template. You can use the sample template to view the template syntax and generation result.
  5. Locale : The language of the region where the faker.js instance is located. This tool supports over 60 regional languages.
  6. Join : How to concatenate multiple string results generated by templates. The join methods supported by this tool are as follows:
    1. None : Directly concatenate the random strings generated by the template without using any connectors.
    2. Comma : Use commas to concatenate randomly generated strings.
    3. LF : Use new lines to connect randomly generated string data.
    4. CRLF : Use carriage return and new line to connect randomly generated string data.
    5. JSON : Convert the generated string array to JSON array format.
    6. JSON Raw : Convert the generated string array to [str1,str2,str3] format.
    7. JSON Compress : Convert the generated string array into JSON array format and compress it into its simplest form.
    8. JSON Raw : Convert the generated string array to [str1,str2,str3] format and compress it into its simplest form.
  7. Count : The number of generated strings, with a range of [1,10000]. The maximum limit for normal users is 10, and there is no limit for VIP users.
  8. Unique : Is the entire string generated using a template required to be unique.
  9. The faker.js version of this tool is 8.2.0 , Reference Documents .
  10. The lddgo time related function of this tool supports dayjs basic formatting fields and AdvancedFormat plugin formatting fields. dayjs Reference Documents.
  11. Reference documents for lddgo related methods.
    Func Parameters Description
    lddgo.number.intSequence(options: {
    start: number,
    step: number,
    type: string,
    paddingZero: boolean,
    }): number
    lddgo.number.intSequence({start:0,step:1,type:'asc',paddingZero:true})   // Starting from 0, increasing by 1, aligning with prefix 0
    lddgo.number.intSequence({start:100,step:5,type:'desc',paddingZero:false})   // Starting from 100, decreasing by 5, aligning without prefix 0
                                                
    1. start : Starting value
    2. step : Incremental or decreasing step size
    3. type : Values of asc or desc indicate increasing or decreasing
    4. paddingZero : Whether to use prefix 0 for alignment
    Generate increasing or decreasing numerical values.
    lddgo.date.randomDate(options: {
    from?: string,
    to?: string,
    format: string,
    }): string
    lddgo.date.randomDate({format:'x'})   // Generate random Unix millisecond timestamps
    // Generate a time within the range and specify the dayjs time formatting string
    lddgo.date.randomDate({from:'2023-10-01 00:00:00',to:'2025-01-01 00:00:00.559',format:'YYYY-MM-DD HH:mm:ss'})
                                                
    1. from : Starting time, optional parameter
    2. to : End time, optional parameter
    3. format : dayjs time formatting string
    Generate a random time within the range and specify the formatting string for the time
    lddgo.date.timeSequence(options: {
    start?: string,
    step: number,
    type: string,
    format: string,
    }): string
    // Generate a time series starting from 2023-10-01 12:55:55, in 5-second increments, and specify the time formatting string
    lddgo.date.timeSequence({format:'YYYY-MM-DD HH:mm:ss',start:'2023-10-01 12:55:55',step:5000,type:'asc'})
                                                
    1. start : Starting time, optional parameter
    2. step : Incremental or decreasing time interval, in milliseconds
    3. type : The supported values are asc or desc, indicating increasing or decreasing
    4. format : dayjs time formatting string
    Generate an increasing or decreasing time series and specify the formatting string for the time
    lddgo.person.chnId(options: {
    areaName?: string,
    birthday?: string,
    male?: boolean,
    }): {
    id: string,
    location: string,
    male: boolean,
    birthday: string,
    age: number,
    }
    // Use all the random parameters to generate the ID card number information of Chinese Mainland. If no parameters must also pass an empty object
    lddgo.person.chnId({})
    // Generate 上海市-浦东新区 male ID card number information
    lddgo.person.chnId({areaName:'上海市,上海市辖区,浦东新区',male:true})
                                                
    1. areaName : Administrative region name, supports specifying provinces, cities, or counties, separated by commas between provinces, cities, and counties, optional parameters. Administrative Region Name Reference .
    2. birthday : Generate the birthday of the ID card number in the form of 2022-01-01. Optional parameters
    3. male : true indicates male, false indicates female, and null indicates no gender specified
    Specify parameters to generate a random 18 digits ID card number in Chinese Mainland
    lddgo.car.carId(options: {
    pa?: {
        normal?: boolean,
        newEnergy?: boolean,
        gua?: boolean,
        shi?: boolean,
        ling?: boolean,
        gang?: boolean,
        ao?: boolean,
        xue?: boolean,
        jing?: boolean,
        yingji?: boolean,
        yingjiMoto?: boolean,
        nong?: boolean,
        nongXue?: boolean,
        air?: boolean,
        wj?: boolean,
        wuHead?: boolean,
        jun?: boolean,
        chang?: boolean,
        eBicycle?: boolean,
        },
    temArr?: []{
        value:[]{
            type: string,
            data?: string|[]
        },
        weight: number,
        },
    }): string
    // Generate license plates for normal and new energy vehicles
    lddgo.car.carId( {pa:{normal:true,newEnergy:true}})
    // Generate license plates for normal cars, new energy vehicles, trailers, training cars, and police cars
    lddgo.car.carId( {pa:{normal:true,newEnergy:true,gua:true,xue:true,jing:true}})
    // Generate 沪A, 沪B, 沪C license plates and trailer license plates, and assign different weights
    lddgo.car.carId({pa:{gua:true},temArr:[{value:[  {type:'select',data:['沪A','沪B','沪C']},{type:'tem',data:'#####'}     ],weight:3}]})
                                                
    1. pa : Generate a specified type of car license plate. All specified types have a generation weight of 1. normal - Normal car license plate. newEnergy - New energy vehicle license plate. gua - Trailer license plate. shi - Embassy car license plate. ling - Consulate car license plate. gang - Hong Kong Entry Exit Vehicle License Plate. ao - Macau Entry Exit Vehicle License Plate. xue - Coach car license plate. jing - Police car license plate. yingji - Emergency rescue vehicle license plate. yingjiMoto - Fire rescue motorcycle license plate. nong - Agricultural vehicle license plate. nongXue - Agricultural vehicle trainer license plate. air - Civil aviation vehicle license plate. wj - Armed Police Number Plate. wuHead - The car license plate of the Armed Police Headquarters. jun - Military vehicle license plate. chang - Vehicle license plates in the factory. eBicycle - Electric bicycle license plate.
    2. temArr : Use custom templates to generate car license plates, support setting multiple templates, and specify different weights.
      1. value : The template array generated by the car license plate, in which all types of fields are combined to form a license plate.
      2. value.type : Template field types support the following types: raw - raw string, the data field is the string value. select - From the data string array, randomly select a value. selectProvinceCity - Use random province abbreviations and city letters, such as 沪A, 苏K. It's data field is null. selectProvince - Use random province abbreviations, such as 沪, 京, 浙. It's data field is null. selectCity - Use random city names, such as 北京, 长沙, 苏州. It's data field is null. tem - Use string templates. In the template # - Representing numbers, ? - Representing uppercase letters , * - Representing numbers or uppercase letters, other characters remain unchanged.
      3. weight : The weight of this template is an integer greater than 1.
    Specify parameters to generate random multiple types of vehicle license plate numbers in Chinese Mainland