So again an issue I had and thought I’d share. I found very little about this on Google. The problem I had was, that I got a JSON response from a site that contained an ID I’d need to use on the next page. The challange was that I had a variable in the regex which JMeter doesn’t seem to like. The easiest way to do this is to use JMeter-plugins!!!
Short post, if it were not for the unlucky fact that I couldn’t use the plugins. So here the long answer….
A common problem in JMeter is that you want a CSV file as an input and want to execute each line, then continue. So from a script perspective that would look something like this:
|-For Each CSV Line
| |-HTTP Request (CSV input)
|-Do something else
The issue though is there is no “For Each” concept in JMeter. I know that it is called a ForEach Loop in JMeter but it isn’t from a developer view. You need to know the length of your CSV file. You could just tell the For loop how many lines there are but that would make it very unflexible. You’d need to adjust the script every time the CSV changes.
So here is how I solved it. Not elegant but it actually works quite well.
Just a follow up on the 2015 Kiwi Workshop on Software Testing (Aug 2015). Find my write-up here:
In attendance this year were:
James Bach, Oliver Erlewein, Richard Robinson, Aaron Hodder, Sarah Burgess, Andy Harwood, Adam Howard, Mark Boyt, Chris Priest, Mike Talks, Joshua Raine, Scott Griffiths, John Lockhart, Sean Cresswell, Rachel Carson, Till Neunast, James Hailstone, David Robinson and Katrina Clokie
Posted in Communities, Event, Exploratory Testing
- Tagged communities, event, experience report, James Bach, KWST, Oliver, Roles, Test leaders, Thought leadership
Sorry for the ongoing spam about JMeter stuff but I am writing a LOT of coding at the moment and I thought I’d share some of the knarly stuff I come accross so others might benefit.
So I had the issue that I need to cobble together MIME HTTP/SOAP calls that contain attachments. JMeter has the ability to add files statically to an HTTP Request (Body Data) but if you need more control you need to roll your own. Best way to do this would be to load the file into a variable and just attach like this:
Content-Disposition: attachment; name="MyFile.pdf"
But how do you get it into the variable?
Some projects require authentication features that involve some quite intricate steps. But fret not, in JMeter we can use Groovy to do the heavy lifting. Below is a very simple example of how you can do a HMAC encryption. It also includes the SHA256 hashing and base64 encoding. The only thing missing are the functions to read the variables from JMeter and publish the hash to JMeter but that is trivial and you can fit it into whatever you already have scripted.
String secretKey = "secret";
String data = "Message";
Mac mac = Mac.getInstance("HmacSHA256");
SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(), "HmacSHA256");
byte digest = mac.doFinal(data.getBytes());
encodedData = digest.encodeBase64().toString();
log.info("HMAC SHA256 base64: " + encodedData);
by Oliver Erlewein
A late report from our workshop last year. I stumbled across it again in my preparations for KWST (Kiwi Workshop on Software Testing) 2015. It was supposed to be published through our gracious sponsor, The Association for Software Testing (AST), but it never eventuated. So I thought I’d post it here. Better late than never.
So here goes….
For the fourth year in a row, Wellington (New Zealand) has successfully hosted the Kiwi Workshop on Software Testing. The two-day intensive testing workshop is one of the key drivers of the Context-Driven Testing (CDT) community Down Under.
In its beginnings, the aim was to give the experienced and senior community members a platform to drive innovation and exchange ideas. The impact of KWST in the community over these past years has had far reaching effects in New Zealand as well as Australia.
Workshops, conferences, and magazines have emerged since, which have lifted the game right across the board. KWST 2014 was specifically aimed at involving new faces in the community and not drawing as much on the established KWST crowd.
The topic this year was:
“How to speed up testing? – and why we shouldn’t”
Threading and keepalives in HTTP are always an issue in performance testing and testing tools. When does a keepalive session start and how many are started is a thing of mystery. So having a bit of clarity helps. On my current project I wanted to prove what thread connects to what server for how long.
This is the second in our series on metrics. We started with a discussion on residual risk (here) and now move on to coverage.
Coverage can be measured in dozens of different ways. For example we can look at functional coverage, requirements, architecture and risks. We could also look at code coverage or database coverage. But as a testing metric they are weak. They all have the same fallacy at their core.
Test coverage metrics ignore the actual quality of what was done. Did we actually cover some feature/code or just touch it? I could cover a piece of code with one test, showing it as tested but there might be a hundred different data constellations that would be relevant to that part of the code. Each one might cause it to fail. Coverage is not guaranteed to answer those questions.
So, CITCON Auckland (http://www.citconf.com/) is over and what a blast it was!
What I really like about this conference is, that there is such a diversity of people coming to it. It is not the usual siloed Dev/Test/BA/… type conference but attendees come from all over. That means the know-how is totally diverse, as are the topics. And these were the topics (click on the pic to get the full res version):
Posted in Communities, Event
- Tagged CITCON, communities, Continuous Deploy, Continuous Integration, Dice, event, experience report, fun, Oliver, Thought leadership
We’re often in a spot, where we have to interview testers for a position. We also get interviewed ourselves. So as someone who considers himself aligning to CDT, how do you recognise who you have in an interview?
Over the years I’ve developed my own style and it gets me usable results but Rex Black and Michael Bolton have put it so nicely into this FaceBook post I really can’t resist posting it here. It makes the point so well I couldn’t possibly add anything more to it.
So if you ever wondered who you are or what a CDT tester interview looks like…
Posted in Communities, Context Driven Testing, Standardization
- Tagged CDT, communities, ISTQB, Michael Bolton, Oliver, personal, possum, Scripted Testing, Test leaders, Thought leadership