Designing your first dynamic VU

This second OctoPerf’s tutorial guides you trough the following steps:

  1. Filtering servers to remove irrelevant HTTP requests,
  2. Handling containers (Also known as Pages or Transactions if you are familiar with other load testing solutions),
  3. Parameterizing the credentials used to connect on the PetStore via a CSV variable,
  4. Creating a Regexp Post Processor and converting it to a Correlation Rule making the whole VU behave as a real user,
  5. Validating the Virtual User.

Notes:

Correlations Rules Frameworks are now available: You can now automatically handle Java, .NET and SAML applications in one single click!

Transcript

0s

Hello and welcome to the second OctoPerf tutorial.

4s

I'm still Guillaume from the OctoPerf team and today we take care of our first virtual user.

9s

But let's go back to where we left shall we ?

12s

We just imported a capture from fiddler and what we have now is a bunch of containers with names that are quite difficult to read.

20s

First we want to be sure that all this traffic is from the application under test.

24s

That's why our first stop is the server menu right here.

29s

In there we can add/remove "servers", in OctoPerf a server is basically just a hostname, port and protocol.

36s

By removing one, we can filter any request to this server from our project.

41s

The only server we care about is this one, since it corresponds to the application under test.

47s

Back to the virtual user, let's start by making it easier to read.

51s

We can remove this empty containers, the requests inside it have been filtered.

56s

We will name our user "Awesome buyer".

60s

Then every container should have a convenient name, that matches its content.

65s

As I said in the first video, virtual users contain HTTP traffic that we will replay.

71s

Of course we want to see how fast it replays and the response time for every request will be measured.

77s

But what if a page contains several requests?

81s

Well then we put all these requests in a container and the container will give us the response time of the page.

87s

Also, naming all the containers makes the virtual user easy to navigate and later, the report easy to read and share.

94s

OctoPerf will create new containers based on the time you spent on every page

98s

so try to wait a second before every click so that every step ends up in a different container.

104s

Ok now it looks better, time to have a closer look at it.

108s

A good first step is to take care of the login request.

111s

The search can help us locate it, since we know which login we used in the application.

117s

There we have it, let's looks around and see all the settings of this request.

122s

First the buttons on the right allow us to move it around, delete or copy paste it.

127s

Note that copy paste works across different virtual user profiles.

132s

We can edit the path, the headers, by the way cookies are handled automatically.

138s

The Think time is a waiting time before sending this request, this is the time I spent on the page when recording

145s

we can change it now or wait until the runtime to overwrite all think times automatically.

150s

In the post data tab we can see all the parameters this request has sent.

155s

First the login and password, then a couple of dynamic values.

160s

As we don't want all our virtual users to put their products in the same cart, we should use different accounts for every user.

168s

This can be achieved in the variables menu, there we can create a constant, random or csv variable.

176s

The CSV is what we are looking for, I will just import this file, that I already prepared.

182s

Next we need to name the columns of the file because this will create the variables we need.

188s

And back to our login request, we need to replace the static values by entering a $ sign.

194s

This opens the auto completion menu allowing us to select the variables we need.

200s

Now that this is taken care of, let's continue with a dynamic value.

205s

As you can probably tell, this looks like the kind of value that is going to change next time we connect to the application.

212s

Most of the time these values are generated on server side and they were sent in one of the previous response to the client.

220s

To locate which one we are going to use the search again.

224s

This points us to this response, to extract something from it, we are going to use a REGEX.

231s

Just drag and drop it directly on the response.

234s

Now if we stick to the configuration tab, we can use CTRL+F to search inside the response.

240s

When something is found, it automatically creates a regex based on a left and right offset.

247s

We can of course replace the offset with a more appropriate value.

251s

For anything requiring more complex work, just go to the advanced tab.

256s

And last the Check tab will show us the results of this extraction without the need to launch a test.

263s

Ok, next we have to use this value we extracted.

267s

Two ways to do so, first manually, by entering a $ sign again in the corresponding field.

273s

But since we already did the most difficult part by defining the regex, we should be able to automate the rest.

280s

By clicking here this regex can be made into a correlation rule.

284s

Applying a correlation rule will not only search for this regex, but also extract and replace the exact match only when needed.

293s

This can save a lot of time when dealing with more complex applications.

297s

In our case two occurrences of this parameter have been found and replaced where required.

303s

Before we move on to the runtime let's take one last step and debug this user.

309s

By clicking on validate VU we launch one virtual user.

313s

When he is done, we will get debug information to check if it worked fine.

319s

The dots here tell us if it is ok or not.

323s

And going back to the regex we can now validate it against the new response.

330s

Also on every request we have a comparison between recording and replay.

336s

This is very useful to understand if it worked and if not what went wrong.

341s

Ok, this tutorial has reached an end for now, feel free to comment for any question

345s

and as usual keep in mind the live chat inside OctoPerf is the best way to talk to us.

351s

Next time we will focus on more advanced design using other logic actions and processors.

356s

Thanks for watching, take care, cheers bye.