TestPlan Raw, Goto, Click, Download and Request Clarification
Document

Raw, Goto, Click, Download and Request Clarification

by Group Public on Thursday January 15 2009 @ 14:27:51 (6/6 Points)

User Guide ✑ Reply ✓ Stick It ✗ Ditch It ⚐ Tag It

Clarification of how responses are handled within TestPlan with respect to protocols and rendering. Supports the Launchpad blueprint.

Raw vs. Rendered

When working with a web application there is a difference between being "on a page" and "retrieving that page". In some cases this difference can be quite vital. In most cases however, the "on a page" interpretation is correct.

For example, when making an HTTP request, the server sends back an HTTP response. This response includes several headers as well as a document body. Once this reaches the browser it is rendered and presented to the user. In the raw protocol response you can get headers, but you can't click on anything. In the rendered form you obviously don't have the headers anymore, but you can click on things.

For TestPlan these two cases will be called the "Raw Response" and the "Rendered Response".

Most actions in TestPlan will work the Render Response by default, as it is what the user deals with.

Downloads

Occasionally a file will be downloaded via the web application. What exactly a download means is troublesome. In general a browser presents the download prompt for file types it does not know how to render; types it understands will simply be rendered.

We'll follow this model of doing whatever the browser does. Downloaded files will however be presented as the raw response.

This will be handled automatically as result of form submission of clicking.

Selenium Problem

Selenium unfortunately has no way capturing downloads, therefore you'll need to call special functions indicating a download is about to happen. These functions will actually perform the final request outside of Selenium (likely in HTMLUnit).

HTMLUnit Rendering

HTMLUnit can render a few more document types than a browser would normally render. In attempts to behave more like a browser these will also be treated as downloads by default.

Extract Request

Instead of going to the document a request object can be extracted. There are two functions to do this GetClickRequest and GetSubmitFormRequest.

These objects can then either be retrieved in raw mode via GetRequest or inspected with InspectRequest.

Please be aware that the requests obtained via these functions are not necessarily exactly the same as those which would have actually been made by the backing agent. The most common use-cases are covered, but there will always be some limitations.

© 2008-2010 edA-qa mort-ora-y
Using Persephone and TestPlan
Tag: