On December 6, we posted some information about the new Data Generator in TestComplete 8.10.
Here are 7 helpful hints for building data:
- To generate random passwords, choose the String data type. Click Configure, and then set both the minimum and maximum character values to 8 (or however long you want your passwords to be). TestComplete will generate random values like this - }KAb1f`Y
- To generate titles for your users, like Dr., Mr., Mrs. and Ms., choose the Value from a Set data type. Click Configure and then add each title to the list of Custom Values. Then set the Generation mode to Random so that each user gets a different title. You can do the same thing for name suffixes, like Sr., Jr., III, and so on.
- You can use the Boolean data type to toggle checkboxes on and off in your tests. Just create a data driven loop that manipulates the checkbox, and set its checked property equal to the value that you've auto-generated.
- Use the Custom String data type to build sentences. For example, let's say you have a Comments section you need to enter text in. Instead of always typing in "My Comment", you can have TestComplete combine other data types, like IP address and City, to automatically generate statements like "127.1.1.1 is located in Boston."
- To generate birth dates, choose the Date and Time data type. Then click Configure, choose Custom from the Date/time format, and then enter MM/dd/yyyy in the Date/time format string. Choose Random from the Generation Mode drop down, and then choose a value like 1/1/1945 from the Minimum Value drop down.
- To generate a number of a certain length, for example, a 3 digit extension, use the String Data Type. Then click Configure and set the minimum and maximum character values to 3, and then uncheck all the boxes except for Digits.
- To generate "Address 2-type" information, such as Apt 23 B and Suite 122, use the Custom String data type. Click Configure, and then enter the following: %SET(Apt,Suite,Site) %Str(1,3,D) %Str(1,2,L) This specifies a set of data (Apt, Suite, Site) that will be randomly chosen from, a 1-3 digit string that will give a numeric to the apartment, suite or site that gets chosen, and a 1 or 2 letter suffix.
We hope you find the Data Generator helpful. Let us know if there are other data types you'd like to see added in future versions of TestComplete.