12.2. Create the HTTP Recording

The first step when building a test case through a recording is recording the test case. To start this, press NewOther…. Then select the HTTP Recorder wizard in the folder Test/Recording and press Next.

Figure 12.1. Invocation of the HTTP Recording wizard

Invocation of the HTTP Recording wizard


Specify the location and the name of the recording file in the next dialog. In this example select HTTP Recorder project as location and set the name of the recording file to bookingExampleLogin. The error marker at the project name can be ignored, is does only warn that the project has no configuration until now. The configuration file will be created convenient to the test case, that is generated automatically after the recording.

Figure 12.2.  Selection of the recording's location and file name

Selection of the recording's location and file name


After pressing Finish the recording starts: A web browser is opened automatically, under Windows® this will be an Internet Explorer.

Figure 12.3. A browser window is opened automatically

A browser window is opened automatically


[Note]Clear the cache of your browser.

The resulting test case of your recording expects a behavior that is matches the traffic between the browser and the server. If the browser has cached files, the responses of the servers may differ from those when the caches are empty. To make the result of the recording reproducible, clear the browser's cache before recording a test case.

From now on everything that is done with the browser is recorded and will be used to generate a test case. For this example specify the http://seam.demo.jboss.com/home.seam in the location bar of the browser.

Figure 12.4. The login page of the sample application

The login page of the sample application


Fill in the login data you have specified previously when working on Section 12.1, “Preparations” and click "Account Login". If the login was specified correct, the first page of the sample application will be displayed as in Figure 12.5, “The login page of the sample application”.

Figure 12.5. The login page of the sample application

The login page of the sample application


After that follow the Logout link in the upper right corner of the sample application. You will reach the login page of the application again.

Now switch to the PETA-Designer and stop the recording by pressing the Stop Recording( ) button in the Recorder Control view of PETA-Designer.

Figure 12.6. The Recorder Control view of PETA-Designer

The Recorder Control view of PETA-Designer

[Note]Stopping the recording

The recording must be stopped through the Stop Recording button in the Recording Control of PETA-Designer. If the browser window is only closed, the proxy settings of the browser are set to the wrong value. This results in a non-working browser, and at the next recording the error message

"IWAT3040E unable to start recorder. Reason: your browser is set in to use a SOCKS proxy. Please de-select it if you wish to record."

will be displayed. To solve the problem reset the proxy configuration in your browser.

After the recording has been stopped, the test case generator generates various files:

Figure 12.9.  The project contents after the generation of the new test case

The project contents after the generation of the new test case