What’s the most interesting tool hack you’ve discovered? – 30 Days of Tools, Day 7

Hello and congratulations on making it to Day 7 of the 30 Days of Tools challenge. :trophy: Now’s a good moment to reflect on the times you’ve worked around a tool to implement a little hack to make it work for you and others.


What’s the most interesting tool hack you’ve discovered?

  • Sometimes a tool just doesn’t quite work for you in how it was designed to be used. What sort of things have you done and with that tool to get around this?
  • Have you ever hacked together a couple of tools to create something unexpected? If so, what was it and what happened?
  • What interesting shorcut hacks help improve your use of a tool?

Some helpful resources

Here are a few blogs that demonstrate the unexpected tools we can build and use in testing:


Feel free to reply to this post and share wherever you like, on the MoT Slack, LinkedIn, Twitter using #30DaysOfTools, Racket, your blog, with your team and any place you feel might inspire yourself and others to do the same. Let’s learn from each other throughout October. Visit the 30 Days of Tools page and select the “Subscribe to Topic” button to receive each daily challenge direct to your inbox.

3 Likes

For a side project I wanted to look whether Visual Testing and Test Driven Development could be combined. It was feasible.

2 Likes

I’ve worked in a greenfield environment and wrote API tests in Postman but the response JSON kept changing due to ‘developers choice’. So it was quite annoying to change all the assertions paths.

So I’ve made my own “Hierarchic Testing in Postman” thing. I’ve made it possible to ONLY write assertions on Collection level in Postman so I would only have to change it in 1 spot.

It helped me a lot, but it was a bit overkill of a setup :stuck_out_tongue:

Same answer as above

Any shortcut is a hack to improve the use of a tool. My most favorite one is probably Ctrl+S - I tend to save so much it’s insane XD
I’m so afraid of losing my stuff :stuck_out_tongue:

2 Likes

Honestly most of my tooling is home rolled. I’ve automated VM creation, I’ve tied slack to terraform and jenkins to produce testing infrastructure on demand in AWS, I’ve spent more time writing tooling than using pre-made tooling. This is probably a legacy of the fact I’ve never worked on an e-commerce site. I’ve never worked long term on anything where existing test tooling is stable or viable to be honest. I’ve always been on the edge of the testing industry.

So yeah, all my tooling is a hack, a bridge between what exists and what I need. If that means I need a serial log parser that also talks to Azure? That’s what I’m writing. If I need a way to get one NUC to have five operating systems on it that I can switch between programmatically and have each talk to different USB ports with passthrough? That’s a ticket.

When I needed to generate 3TB of random data and then ascertain if it was within X km of points of interest on the surface of the Earth using lat and long? I’m writing it.

I sometimes think I’d love to have access to tooling that can do all the heavy lifting for me, but secretly I know that I love the challenge. Where’s the fun in just writing some page object (or the testing model du jour) for a website, when you could instead be using statistical analysis of gigantic data sets to ensure consistency of results across the whole thing?

You don’t know magic until you’ve seen Bloom filters in action.

2 Likes

Sometimes a tool just doesn’t quite work for you in how it was designed to be used. What sort of things have you done and with that tool to get around this?

I stopped using it!
If I have to use it (company or team or client obligation or just I know it is a relevant tool) I try to improve it (I had some issues with jenkins pipeline so I did some improvement) or I ask for improvement/help to my team/company/the community and when I like the tool I create them a bug report (or a feature request) :gift:

Have you ever hacked together a couple of tools to create something unexpected? If so, what was it and what happened?

I used code injector (Code Injector – Get this Extension for 🦊 Firefox (en-US)) to put a color over elements without IDs.

What interesting shorcut hacks help improve your use of a tool?

Ctrl+C Ctrl+X Ctrl+V Ctrl+Z Ctrl+Y Ctrl+S…
On Jira I used a lot of shortcuts Using Keyboard Shortcuts | Atlassian Support | Atlassian Documentation.

3 Likes

Scripting in Postman :slight_smile:
For example: I needed to create a failed order in our payment system to test a particular edge case. So I put together a little script with a loop querying the orders API. When a new auto-order was created in the system, the script immediately sent another API call deactivating the user’s payment instrument, which caused the order to fail.

4 Likes

Got a spare mo? Have a listen/watch of Richard and Mark exploring Day 7’s challenge. :tv:

2 Likes

Sometimes a tool just doesn’t quite work for you in how it was designed to be used. What sort of things have you done and with that tool to get around this?

If you encounter resistance like that when using a tool, this is the world telling you are not using the right tool. We’re fortunate enough these days to have a huge amount of tools (see Day 6), it is even hard to keep on top of all of them. Re-evaluate your strategy, re-evaluate your approach, re-evaluate your tool. 9/10 things should not be hard because somebody already has encountered that exact issue and has shared a solution that you just need to find.

Have you ever hacked together a couple of tools to create something unexpected? If so, what was it and what happened?

Never, guess I’m just lucky.

What interesting shorcut hacks help improve your use of a tool?

Not a hack per say, but in automation world, building your own DSL, that speaks an ubiquitous language everybody in the business understands improves the ease of maintenance of that tool by a lot and maintaining that abstraction was always worth it in my experience.

2 Likes

What’s the most interesting tool hack you’ve discovered?

  • Sometimes a tool just doesn’t quite work for you in how it was designed to be used. What sort of things have you done and with that tool to get around this?
  • Have you ever hacked together a couple of tools to create something unexpected? If so, what was it and what happened?
  • What interesting shorcut hacks help improve your use of a tool?

Tough one.

The best I can come up with is this.

We use Cypress - but - as you might be aware, Cypress runs in an iFrame.

Some of our pages require variables that sit at the ‘top’ level of the browser window. So they’re accessed through functions like window.top() - which won’t work during in Cypress.

The fix of course, is that our pages shouldn’t do that - it’s kinda yuck. But, that’s too big for right now.

Instead, one of our talented engineers has used Cypress’ override capability to define a new cy.visit() function that will work for us.

It looks something like this:

const coreGlobals = [
    'global_var_1',
    'global_var_2',
];

Cypress.Commands.overwrite('visit', (originalFn, url, options) => {
    return originalFn(url, {
        ...(options || {}),
        onBeforeLoad: (win) => {
            if (options && options.onBeforeLoad) {
                options.onBeforeLoad();
            }
            coreGlobals.forEach((globalName) => {
                Object.defineProperty(win.top, globalName, {
                    get: () => win[globalName],
                    configurable: true,
                });
            });
        },
    });
});

This takes any of those top level variables that it finds, and injects them back into the window Cypress is running in.

This way, they’re now accessible in the Cypress window without us having to make significant changes!

3 Likes
  1. Form filler

Some times form filler somehow doesn’t work the way you’d expect when comparing to manually typing into the fields. For a quick & dirty way of entering into the fields, easier way I found than using formfiller / JS scripting was using Autohotkey. It works quite well regardless of it being web application or .NET or whatever since it can be used to send key strokes to the window (even better if you have the HWND info of the control).

But ever since I moved to using Mac where Autohotkey is not available, I’ve been using Hammerspoon

  1. Excel

If you ever worked with Excel spreadsheet for analysing .csv files that involves large number, you may know that number larger than 14 digits (or more, I can’t remember) rounds everything down to 0s. (e.g. 1234567890123456 appears as 1234567890123400). Or a number that starts with 0 (e.g. phone number or bank account) have 0 removed automatically.

This can be quite tragic especially if you ever worked in a bank domain where rounding issue is a big thing.

A common work around that wise people in internet tells you to do is add ’ in front, or just prefix it with some random non-numeric character.

What they don’t tell you however is that you should never open the file in Excel in the first place as the rounding/trimming has already taken place, and adding the prefix in the front of the number doesn’t help anymore :sweat_smile: You need to add them before opening the file in Excel.

I got around this problem by using Notepad++ regex replacer. You could do pattern match then add some non-numeric prefix like x in the front.

e.g. search by /,([0-9]+),/ replace with ,x$1,

Then you can record the replacement process as macro in Notepad++, then open the file in Excel.

So with above Excel experience, it’s still two steps process where I have to remind myself to open the file in Notepad++ before Excel. Since it was getting too tedious we just told the other team that provides .csv file output to add x in front of those numbers. This isn’t really a workaround on “tools” - rather it’s a workaround on the work process, I suppose.

Do you mean shortcut “keys” that helps ? If that’s the case, I think more time you spend on using shortcut keys just increases your productivity as a person working with computer in general. There’s too many that I just know by heart coming from gaming background playing a game that encouraged players to use 40+ customizable hotkeys… (Ragnarok anyone?)

Otherwise, if you mean how would one get better at using a tool, I think best way to improve is in using the tool as much as you can, experimenting what it can do / cannot do. One could argue if you are faced with workarounds, you may not be using the right tool, but you could be stuck in a situation where you are just forced to using it. Besides, it’s quite fun to find the workarounds and forces you to be creative

2 Likes

I cobbled together a solution to facilitate test automation for calls between SIP phone/protocol and analog POTS (plain old telephony service) phone line (the latter end/side using proprietary in-house tooling & special hardware). The solution involved glue code & mashup of the in-house tool with a GUI automation of a desktop software based SIP phone, audio redirection drivers to manage the call audio path I/O, media player to “send” audio and tone detection software to “validate” audio & DTMF keypresses.

2 Likes

I encountered an issue with Playwright java where I couldn’t get it to click an element but not result in an error. I was unable to fix this, but it ran just fine with equivalent Selenium.

A few years back, after seeing our front end use React, I took the component concept and applied it to our Selenium framework. So instead of using page objects, we took it a step further with component objects which enabled highly reusable code when combined with expected data attributes in our React design system component library.

I also came upon the realization that we could compose cucumber steps, which made me think about making component specific steps that then scenarios could further use.

Honestly, most things these days are done with hacks. You take existing tools and splice them together to make tools you will use.

2 Likes

What’s the most interesting tool hack you’ve discovered?

This is a hard one. I feel like at one point when you’re doing this kind of stuff, you could be doing something different.
Those are the moments I start talking to the developers and they’ll say: “You can just do …”. Which would be easier. There are people out there that are much smarter than I am and have encountered the same problems. I can stand on the shoulders of those giants and use their solutions instead of trying to hack it myself!

But my all means try to hack it yourself, make mistakes and learn as much as you can!

2 Likes