TLDR; Generate CounterStrings, random data from Regex, ranges of data, and strings made by concatenating repeated data.
I released a new version of my CounterString generation Chrome Extension with new features and a new UI.
CounterString Extension
Source and Download Links
I have a tool page for the CounterString extension with more details.
But you can find the tool:
Overview
I first released the CounterString Extension in 2019 (I think), and at that point it was a simple input field that created a string and added it as a value to the input field.
Now it can:
- Generate CounterStrings
- Configurable length and delimiters
- Generate Random Data From Regex
- Generate Character Ranges
- Repeat text, characters and regex
- Add generated data as value, with input event, to an input field
- Trigger Key events to ’type’ the data with configurable speed
- Binary Chop Calculator for field length exploration
Some of this was a result of migrating code from my Java Test Tool Hub (which I think I worked on about 12 years ago):
From the Test Tool Hub I took the:
- Robot - I had to find a different way of triggering events, but this allows ’typing’ the data into the field rather than just amending the value.
- Increased customization of the CounterStrings
- Ranges of Data
- Repeated Data
- Binary Chop Range Calculation
And the Data from Regex was repurposing some code from my AnyWayData.com test data generator which uses the same JavaScript library to generate data from a Regex - RandExp
CounterStrings
I wrote about CounterString Algorithms in an earlier blog post.
This extension uses both reverse generation and forward generation.
I initially learned about CounterStrings from James Bach. James has a tool called PerlClip which is a command line tool to generate data directly into the clipboard. This uses a reverse algorithm where the full string is generated and then reversed to paste into a field.
A forward algorithm allows ’typing’ the String character by character without generating the full string first.
While I don’t generate the full String first, I do precompute a Schema which I then follow to generate the String, so it takes about the same processing time, but uses less memory and allows streaming of the result.
I created a different algorithm this time, which is much simpler to understand, but probably takes longer to execute. I’ll need to update the algorithm page at some point, but you can see the algorithm implemented in the source code.
Other CounterString Tools
A quick hunt around the web revealed a few more CounterString tools that I don’t think I had found all of these before. So these might be interesting for anyone thinking of creating their own implementation.
- PERL: https://www.satisfice.com/download/perlclip
- TYPESCRIPT: https://github.com/j19sch/counterstring/
- RUBY: https://github.com/jamesmartin/counterstring
- JAVA: https://github.com/eviltester/testtoolhub
- PYTHON: https://github.com/deefex/pyclip
- RUST: https://github.com/thomaschaplin/rust-counter-strings
Another Chrome Extension:
-
https://github.com/Pawel-Albert/utilities-for-testing-extension
- and some associated Test Pages that I haven’t seen before
- https://pawel-albert.github.io/utilities-for-testing-extension/
Join our Patreon from as little as $1 a month for early access to videos, ad-free videos, free e-books and courses, and lots of exclusive content.
Top comments (0)