Almost every thread I come across (here, Reddit, anywhere) where people ask about what tools people are using day to day for their testing role, a very frequently mentioned item is Python, “for scripting/automating small tasks”.
The problem for me is, no one ever elaborates on what those small tasks are. So that’s my question - if you’re using something like Python (or equivalent) to automate or otherwise help you in your everyday work, what exactly do you use it for?
You can check some of my articles with examples of how I’ve used Python scripting. It’s not about writing autotests or automation frameworks it’s more about using scripting/programming to automate particular actions, tasks, data generation, generate load and simulate some users’ actions, etc. And of course, data generation is an additional topic (but I don’t have an article with script examples on this topic) - I used Python to generate some random test data, for example by using an app’s API.
I am involved in testing software on hardware devices. These devices need to talk to each other and they are sending data over the ethernet to each other. So to test that I use python script to e.g, generate test data, to monitor the data or the message rate on the different channel, I use scripts to configure the devices, to update firmware or to monitor the CPU usage (e.g. performance tests). But I also use python scripts to query the JIRA API to check the list of tickets assigned to a certain release etc. …
Mostly I’ve used scripting for test data generation, I’d much rather spend a bit more time to script up something re-usable, than have to start from scratch each time + it constitutes to the Don’t Repeat Yourself (DRY) principle of software development.
I often use it to automatically extract data from systems like Jira or Jenkins via their respective APIs–or even to automate adding items to Jira. It can also be handy if you use text-based documentation–I was recently using the pylatex package to generate some appendices for a LaTeX document that depended on data exported from another system.
I haven’t used it for entering bugs, per se. More for stories or subtasks, particularly for stuff we know we need to do periodically or for every release.
Hi alex,
can we connect on some platform to discuss over testing software on hardware devices? I recently shifted to a project involving hardware and software interacting one another and i need to test it.
i have many questions regarding it
let me know where we can connect. it would be a great help. thanks
glue
Scripting is a glue, to link things together tightly.
And to that end I’m doing things like grabbing settings from files, putting them into various apps via a commandline or doing the opposite to put settings into various files.
Basically moving data around, one of my favourite scripts when I worked at a large company was a small script that copied test result pass/ fail data out of the Jenkins CI and pushed it to a LED display panel. So there are some more exciting script use cases out there for sure.
My other boring but definitely main use-case for scripting is environment checks, where the script checks system package installation and state and networking connections to let me know a machine is not find it has missing modules or something. And by far the most boring use of scripts is to actually set machines up, boring because you really need it when you need it, but then you never use it for a few months until the next machine needs to be re-formatted again.
Scripting (for me) is best used when we have certainty, “I do this and it does that” style of testing. Basically we know what we want from something and want to confirm, or we want someone else to confirm it and want to give them a pre-defined path for how they get there.
It’s also good for sharing ways of working to others, like if we were doing UAT and want to tell people how a happy path works.