Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to create a random login with Faker on Java

I need to create a random user for autotests with Faker. For that I need to obtain a random login and password. How can I done it?

I suppose that for passwords I can use

faker.internet().password()

And I don’t know what to do about login.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

If you would like to use an email address along with a password:

faker.internet().emailAddress()
faker.internet().password()

If you would like to use a username along with a password:

faker.name().username()
faker.internet().password()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading