On Web Load Testing

Recording tests with Firefox and Chrome

By default WAPT uses embedded Internet Explorer window to record virtual user profiles. In most cases this is the most convenient way, because you do all the things inside one application. When running the test WAPT does not use any browser. It performs all the work itself making the whole process very efficient. It can generate thousands virtual users from a single system, where as it would be hardly possible to launch so many browser instances.

However in real world people use different browsers, and in some cases it is important to emulate a specific one. A web site can deliver significantly different content depending on the client browser. Some sites can be accessed only from a specific browser or a mobile device.

When working with a web site the browser identifies itself by passing corresponding value inside the “User-Agent” header of each HTTP request. Web site can use this information to provide browser-specific content. Even though we can easily change the value of that header in WAPT, we may face a situation when web site provides totally different responses during the test run, because a different user agent is specified. So, the right way in such cases is to record the whole test using the browser that we want to emulate.

Let’s see how to do this. Like many other web testing tools, WAPT records tests by inserting itself as an HTTP proxy between the browser and the web site. Since all the requests sent from the browser have to pass through this proxy, it can record them. However such configuration also allows any external browser to connect to that proxy. In this case WAPT will record all requests sent by that external browser too.

Let’s open the Recorder tab in WAPT Settings. Here we see the recorder options.

The one that we need is the port number. By the way, we can specify a different port here, if needed. This is the port that WAPT uses for listening for a browser connection.
Note that since we will be using an external browser, the “Delete temporary Internet files” and “Delete Cookies” options will not work for it. So, if we want to record a “clean” session, we should delete the browser cache and Cookie in that browser manually.

Now let’s change the proxy settings in our browser. In FireFox this is done on the “Network” tab of the “Options” dialog. Click the “Settings…” button here to open the “Connection Settings” dialog.

Here we enter the “localhost” for HTTP proxy name and “9471” for the port number (same one that is specified in WAPT).

Note that we can also record tests from a browser running on a different system. This is important if we need to record a test from a mobile device or a different platform. In such case we can configure the browser same way, but instead of “localhost” specify the name of the system where WAPT is launched.

Now let’s deal with Google Chrome. It uses proxy configuration specified in the system Internet Options. These are the same options that are used by the Internet Explorer. To edit them open the “Internet Options” dialog.

If you are using a dial-up or a VPN connection, select it in the list and click the “Settings” button near it. Now you can specify the proxy address and post.

If you access Internet through your LAN, click the “LAN settings” button instead and specify the proxy settings in the “Local Aver Network (LAN) Settings” dialog.

Note one very important thing. If you record with Chrome, external IE window, or any other browser that takes proxy configuration from the system Internet Options, you should disable the “Use Internet Explorer proxy settings” option in WAPT settings (it is available on the Recorder tab shown above). Otherwise WAPT will connect to itself in a loop and recording will not work.

When we are done with configuring the browser, we can start recording as usual. Click the “Rec” button in WAPT and start working with your web site in the browser. All your actions will be recorded and added to the profile.

You may only notice one difference that may seem annoying. Since WAPT is no longer integrated with the browser window, it cannot distinguish between page requests, sub-requests (ones initiated automatically as a result of processing page in the browser) and page elements. It records all requests in one long list. However you can put this in order manually. After recording you can select any elements in that list and drag them under parent request. You can also select sub-requests, right click on them and choose “Convert to page elements”.

And one final note. Don’t forget to restore browser proxy settings after recording. Otherwise your browser will not work without WAPT.