What are String Generators?
String Generators can be used to compare, evaluate, combine, or manipulate strings (replace characters, change cases, remove extra spaces, etc.).
Please note that you can use Linked Generators to generate data to meet complex testing needs by using the Generators below with others.
Available String Generators
The following generators can be used when working with strings:
Generator | Description | Examples |
CompareStringGen | Returns whether two string values are equal or not. It can compare two constant values or reference Attributes that generate the string values. | Two referenced Attributes generate the following stings for three records: Attribute 1 - Apple, Carrot, Tomato Attribute 2 - Apple, Broccoli, Tomato Generated values - true, false, true |
ConcatGen | Combines two or more values and returns a single-string result. | Example 1 - Concatenate 'Hello' and first name generated by another Attribute or Generator along with a comma. The result would be:
|
ConcatBoolenGen | Allows the concatenation of elements based on a Boolean reset value, separated by a delimiter, to generate accumulated data. | Example data set = red, yellow, green, blue reset = true, false, false, true, true delimiter = | (pipe) Output true = red false = yellow false = yellow|green true = blue true = red |
ConcatNumberGen | Allows the concatenation of elements based on a resetNumber value, separated by a delimiter, to generate accumulated data. | Example data set = 1, 2, 3, 4, 5 Reset Value = 5 Delimiter = | (pipe) Output values:
|
ConcatParentChildGen | Allows the concatenation of parent/child elements, separated by a delimiter, to generate an accumulated hierarchical directory or ancestral structure. A child is added to the hierarchy each iteration, while a parent is only added to the hierarchy when the parent value changes. The result is a concatenation that resembles a hierarchical directory or ancestral structure. | Below is an example where the parent changes in the following sequence: 1/1, 1/4, 6/2, and 8/1. The child starts at 2 and continually increases by 1.
|
ConstantGen | Generates a constant, non-changing value. | Examples:
|
EncyrptGen | Encrypts a string using various encryption algorithms. Value can be constant or referenced. | Example: Reference the id Attribute for a test Domain.
7ADA4EAA22F1D49C01E52DDB7875B4B |
FillerGen | Generates a repeating value as a filler. | Examples:
|
MatchStringEvalCaseGen | Checks a list of values for a match to a compared value. The list of values may be a set of Constants, Attribute references, or a combination of both. The match types are:
The match conditions are:
| If compare value = 'table' and matchType = 'contains' and matchCase = 'true' and the list of values =
then matchCondition:
|
MatchStringGen | Checks a string for a value match using the contains, startWith, or endsWith matching functions. | An Attribute is generating a string that contains 1 letter as the starting character and then random numbers.
If the string starts with 'C' it should return 'true', otherwise 'false' Generated data values for four strings above:
|
NumberToWordsGen | Converts a constant or referenced number value to words. | 2 = Two 52 = Fifty-two |
PadGen | Pads a value either to ist left or right. | Example 1 - 000red Example 2 - red000 Example 3 - 000red000 |
RandomStringGen | Generates a random string based on lengths passed. You can define the length of the string, select specific string types, include only specific characters, or exclude specific characters. | letters only - eUyrTSg numbers only - 89645231 letters and numbers - c85YT9q1 special characters - *#&&@! ASCII characters - x'3f6!7dwP |
RandomLetterGen | Generates between 1 and 100 random letters and returns them as one string. Letters can be all lowercase, all uppercase, or mixed. | Examples with 10 letters:
|
RangeConstantGen | Creates an increasing value similar to the RangeGen; however, you are able to add a prefix and/or suffix to each generated number. | Example 1
Example 2
|
RegularExpressionGen | Produces a result by evaluating a regular expression using a constant or referenced value. Examples of regular expressions include:
If 'true' returned, then passCase provided; otherwize, failCase provided. These can be a constant or referenced value. | Example Values: 123, happy, TOO regularExpression = [a-z] (lowercase) passCase = true failCase = false Output values: false, true, false |
StringCaseGen | Changes the case of a generated value to CapitalCase, UpperCase, or LowerCase. | CapitalCase - Apple UpperCase - APPLE LowerCase - apple |
StringEscapeGen | Escapes strings written in CSV, Java, JavaScript, HTML, XML, JSON, and SQL. You can enter a constant string value or reference another Attribute or Linked Generator. | Example String - "hello" escapeJava = \"hello\" escapeCSV = """hello""" escapeHTML3 = "hello" escapeXML10 = "hello" escapeJSON = \"hello\" |
StringUnEscapeGen | Unescapes strings written in Java, JavaScript, HTML, XML, JSON, and SQL. You can enter a constant string or reference another Attribute or Linked Generator. | escapeJava - \"hello\" becomes "hello" escapeCSV - """hello""" becomes "hello" escapeHTML3 - "hello" becomes "hello" |
StringIndexOfGen | Returns the index of a specified character or substring in a particular string. | Example values = *red, yel*low, green*, blue value = * Output = 0, 3, 5, -1 and repeats |
StringLengthGen | Returns the length of the referenced string. It can be a constant or referenced value. You can also exclude a value such as 'null', and the returned count will be '0' each time that value is encountered in the referenced values. | teleport = 8 178rt4Uko23 = 11 date = 4 |
StringRegexGen | Generates data that matches with Regex. | regex = [a-z][A-Z][1-6][*] output = kX4*, eB3*, 2D4*, qY3* |
StringRemoveGen | Removes a token value from a referenced value. You can remove all occurrences, the first occurrence only or the last occurrence only. This can be for a constant or referenced value. | Example - /Engine/ If remove all occurrences of '/', then generated value would be = Engine |
StringReplacementGen | Returns a string replacing all the sequence of characters matching regex and replacement string. You can enter a constant value or reference an Attribute or linked Generator. | Example 1 - For every occurrence of 'user' in a referenced Attribute value, replace it with 'name'. Example 2 - Remove extra spaces in generated values. Reference the Attribute and use \s in the fromText parameter.
|
StringReverseGen | Reverses a string that the user inputs. | Example - Blue Becomes - eulB |
StringSplitIndexGen | Splits a constant or referenced string value by delimiter, which in turn creates an internal list. The elements in the list can then be accessed with the help of a list index. | Example Strings
Generated value with index set to '1'
Generated value with index set to '3' and ignoreBound 'true'
|
StringTypeEvalCaseGen | Check what type of content the string contains. You can enter a constant value or reference another Attribute. If the result of the evaluation is true, then the value of castTrue will be returned for the record. Otherwise, the value of caseFalse will be returned. Both parameters can have a constant value or reference another Attribute. You can perform the following checks:
| Example Strings:
If I check for isNumeric with caseTrue = 'true' and caseFales = 'false', the returned values would be:
Alternatively, caseTrue could reference another Attribute when 'true' rather than be a constant value. |
StringTypeGen | Check what type of content the string contains. Note: This generator works just like the StringTypeEvalCaseGen above; however, you cannot specify the evaluation value for when the case is true or false. It only returns 'true' or 'false'. | See the example above for StringTypeEvalCaseGen. |
SubstringGen | Returns a substring of characters within a larger string of characters. | To see an article example, click here. |