Skip to main content

CounterString Extension

Want to generate CounterStrings to support your exploratory web testing? Install this extension and that’s what you can do.

This is an open source extension, you can find it at:

https://github.com/eviltester/counterstringjs

Description

A CounterString is a string of text e.g. *3*5*7*9*12*15* where:

  • the string is a specific length e.g. 15
  • the last character in the string is an *
  • the numbers before each * are the position of the *

This can act as Test Data for helping test the length allowed in forms and other data fields. If the value is truncated then you can tell from the numbers and the ‘’ how long the string is e.g. *3*5*7*9*12*15 is 14 characters long because the ‘’ after 15 is missing.

Counterstrings are commonly used in exploratory testing.

This extension is a simple CounterString generator, which:

  • displays a dialog asking for the number of characters,
  • then generates a CounterString of that length
  • the CounterString is logged to the dev console to allow copy and pasting,
  • the extension also inserts the CounterString into the value of the field that was selected when the right click context menu was displayed
  • this supports supports testing online forms.

Instructions for use:

  • right click on and input field
  • enter value of CounterString
  • CounterString will be logged to the console (use dev tools to see it)
  • CounterString will be inserted as the value of the WebElement you clicked on

Note:

  • works with forms on the actual page
  • this extension does not work with forms embedded in frames

How to Install as Chrome Extension?

At the moment the extension is not on the Chrome web store so has to be manually added as an “unpacked extension”.

To install:

  • download the zip file from releases
  • unzip the file
  • visit chrome://extensions
  • switch on Developer mode
  • Click Load Unpacked
  • choose the extension folder (the one with the manifest.json in it)

This is an open source extension, you can find it at:

https://github.com/eviltester/counterstringjs

You can also download the code to use as a Snippet in your console or dev tools from here

Watch on YouTube

Can I see it in Action?

In this demo you will see it in action and, as a bonus, see it help me find a bug in Github.

Watch on YouTube

How was it built?

I released some tutorial videos showing how I built it.

As a Snippet

Watch on YouTube

As an Extension

Watch on YouTube