Follow a link from the previous request

This tutorial looks at the case where the request type Follow a link from the previous request is used. This is one of the methods provided by NeoLoad for extracting data from an HTML page returned by the server. For more information about the various methods of extracting data, see Choose a data extraction method.

This extraction method can be used when a request is the result of a standard HTML link of the type <a href=""...>. The aim is to play back a link and its parameters as returned by the server during the test instead of playing back the recorded link. This tutorial will show you two ways of telling NeoLoad how to follow the link: either to search for an attribute containing a specific value, or to search for one or more values in the link parameters.

The tutorial describes one of the steps in the methodology relating to designing a Virtual User. For an overview of designing a Virtual User, see Design process.

Understand the problem

An HTML page often contains dynamic elements generated by your application. Typical examples of such dynamic elements are request parameters used to determine a context, a search context for instance. The following code is an extract from an HTTP response containing such dynamic elements.

<HTML> 
   <BODY> 
      ... 
      <A href="index.jsp?searchID=24257622&page=2">Next Page</A> 
   </BODY> 
</HTML>

The HTML page displays a link called Next Page that refers to the index.jsp page with two dynamic parameters: searchID and page. If this link is followed during the recording phase and replayed in a scenario, NeoLoad will use the recorded values. This is definitely not the desired behavior and this tutorial mainly addresses this issue.

To deal with dynamic URLs, NeoLoad provides a mechanism that automatically finds a URL in the previous HTTP response and injects it in the following HTTP request.

Ensure this tutorial applies to your case

For the purposes of this tutorial, a scenario has been recorded, in which you can start on a search page, enter your search criteria, and browse the results going from one page to the next. The following illustration shows a very simple page of results. The search criteria have been entered beforehand and the user is browsing the results from page to page:

The following screenshot shows the content of the HTTP response for this HTML page. As explained previously, it contains a link that refers to the page index.jsp, with two dynamic parameters: searchID and page.

You might obtain this screenshot by selecting the page containing the Next page link. You might then select the HTTP request, click on the Advanced button and select the Recorded response tab.

This tutorial will show you several ways of telling NeoLoad how to find and follow the HTML link Next Page.

Follow the link

This section shows different ways to follow links:

  • How to follow a link using attribute value.

  • How to follow a link using the definition.