Random Date of Birth generator

Hello, guys, I don’t know anything about coding. And I want to generate random date of birth in DD-MM-YYYY format but YYYY should be in range of 1980-1995. And DD/MM must be changed every time.

see below code;

“Command”: “type”,
“Target”: “xpath=//*[@id=“divMain”]/div/app-user-registration/div[2]/div/div[2]/div[4]/form/div[10]/div[2]/p-calendar/span/input”,
“Value”: “DD-MM-YYYY”

Anyone please help me to generate DOB in DD/MM/YYYY field.

Thank you.

selenium ide excecute scripts examples here

The one you need are:

  • return 1950+Math.floor(Math.random()*60) - random year between 1950 and 2010
  • return 1+Math.floor(Math.random()*28) - random day between 1…28
  • return 1+Math.floor(Math.random()*11) - random month between 1…12
1 Like