Friday, June 7, 2013

Random data for tests


Random data for tests

Sometimes tests need random data. It could be that a test cannot register a user more than once.

This is a quick command to generate a random series of characters. Give it a number of how many characters you want.

String name = RandomStringUtils.randomAlphabetic(20);

It does require the Apache Commons Lang library. http://commons.apache.org/proper/commons-lang/



© Copyright 2013 LMN Solutions
If you  have a question e-mail us or add a comment.


LMN Solutions - Find out more about us.
Selenium Training
selenium@lmnsolutions.com

No comments:

Post a Comment