Friday, March 27, 2009

Quantified String Generator

After reading my previous post "The Magic of Size Based File Generator" many of my friends had explored other features of Testersdesk.com and told me to continue posting about other features.

Let us have a look at the tool “Quantified String Generator” of Testersdesk.com.
If you need to test a field that accepts 255 characters maximum, we test it by passing 255 characters and 256 characters. We prepare 255 character length string and paste it in the field, but how do we know that all the 255 characters are pasted in that field? We again copy the string from the field and paste it in a word doc and check the word count. How many times in a day we do this for different fields and imagine how much time this is taking.

By using the tool “Quantified String Generator” of Testersdesk.com, we can generate Quantified Strings - Strings that can indicate the position of a character anywhere within. See the below image of the tool:

If you want to generate a 255 characters length string, enter “255” in “Text Length” field and click on “Generate Quantified text” button. A 255 characters length string will be generated which will be in the below format:
$3$5$7$9$12$15$18$21$24$27$30$33$36$39$42$45$48$51$54$57$60$63$66$69$72$75$78$81$84$87$90$93$96$100$104$108$112$116$120$124$128$132$136$140$144$148$152$156$160$164$168$172$176$180$184$188$192$196$200$204$208$212$216$220$224$228$232$236$240$244$248$252$256
In the above string you can see $ separated by numbers, each number in the string specifies the position of the next $ character.
Let us say when the above generated 255 characters string is pasted in a field and the string is pasted as below:
$3$5$7$9$12$15$18$21$24$27$30$33$36$39$42$45$48$51$54$57$60$63$66$69$72$75$78$81$84$87$90$93$96$100$104$108$112$116$120$124$128$132$136$140$144$148$152$156$160$164$168$172$176$180$184$188$192$196$200$204$208$212$216$220$224$228$
As I said before that each number specifies the position of the next $ character, by seeing the above pasted string we can easily say that only 228 characters are pasted in the field. The advantage of this tool is that we can generate string up to 1000 characters and can also one can tell the string length by just seeing it.
There are other tools in “Common Test Data Generators” section of Testersdesk.com where we can generate strings in any language, random numbers etc. Do explore the other features as well. Contact me if you have any questions.

0 comments: