Recording Modes
Badboy offers two different recording modes that you can use. These are:
- Request Mode (the default mode)
- Navigation Mode (activated using toolbar button or by holding
down Ctrl-Alt while recording)
You can see which recording mode is being used by looking at the 'N' button on the Toolbar:
In this mode Badboy records the HTTP requests that are sent by the browser
to the server, including all their parameters and other information. In a
simplistic sense, you can think about Requests simply as URLs, such as the
address for your web page. There are advantages
using this mode:
- Requests are independent of the layout and appearance of the web pages
you are testing. This means that if the layout of the web pages changes your
test will still work.
- Requests work excellently with Badboy's Load Testing features and they
also can be exported to JMeter for doing load and stress testing. Although
Badboy can load test pages using Navigations, they do not work as efficiently -
so if you need to do load testing at very high levels then recording your tests with Requests
may work better for you.
However there are also some important disadvantages:
- In some cases Requests can be more difficult to get working. This is because
Requests completely replace the information sent by the web page to the
server with the recorded HTTP information. Sometimes web pages put
information into the page which has to be specially calculated for each
time a user goes to the page. In that case, Requests need to have their
Parameters changed to use variables after you record them (see Using Variables for more
information).
-
While Requests are independent of the page layout and appearance, this can
sometimes be a drawback. For example, imagine that you edit a page and
accidentally delete the "logon" button. You would probably like your
test to fail so that you could find and fix the problem. However when
you use Requests this will not happen! Instead, Badboy will play the
Request the same way regardless of whether the logon button is there or
not. Of course, you could explicitly check whether the Logon button
is there by using an Assertion (see Assertions), but to do that you would have to
create the Assertion in advance - it would be very laborious to check every item
you record this way. Instead, Navigation Mode can help you overcome this problem.
Navigation Mode
In this mode Badboy
will record which browser element you clicked on.
When you play back, rather than replaying the HTTP request that was sent
previously, Badboy will find the original browser element
that you clicked on when recording and simulate a click on it.
Navigation Mode has the following advantages:
- For some pages it is much easier to get working. This is especially
true for complex pages such as Logon pages. The reason is that the
Navigation is replaying the interaction to the browser and letting the
browser do the work of creating the request.
- Because Navigations explicitly exercise the user interface they are
much better at catching problems if the interface is broken. In the example
above for Request Mode, if you had recorded your "logon" button as a Navigation
your test would fail if somebody deleted the button from the page.
The main disadvantage of Navigation mode is that you often cannot use this
mode for running load tests. This is because the Load Test engine runs without
displaying any user interface, and hence it cannot execute Navigations. Another disadvantage is that
your tests will depend on the correct items being present in the user interface to work. Thus
if your main goal is to just test that the functionality of your web site works without
caring about the user interface, Request mode may be better.
The difference between these two modes is very important. The choice you
make in recording will have a big effect on how well your scripts adapt to
changes in your web site. See below for more information on deciding which
mode you should use.
For more information on Navigations, see the Navigations topic.