I try something like this but am not getting the proper results I am wanting it is using the exact string I want it to be random and for it to be able to renter that same random email address for login?
**var reg="******@email.com
SendKeys(reg)
SendKeys(reg)**
CodePudding user response:
Your question is a little unclear, but I think you want something like:
var reg = $"{Guid.NewGuid()}@example.com";
SendKeys(reg);
SendKeys(reg);
This will create a totally random email address every time.
CodePudding user response:
You might wanna look at the Bogus library which I frequently use when testing database operations including migration where I want a large amount of random data. But the thing about this is that you can specify a random seed so that the data, although random, will allow you to have reproducible results which comes in quiet handy especially when doing mocking. You can generate whole class instances with properties with generated values for City, Email, Phone, Name etc. You name it, its got it. AND it is VERY easy to use.
