webtest.correlate

This module provides a subclass of WebtestRunner designed to aid you with finding parameter values in HTTP responses. It does this by attempting to match parameter names found in each request to the response body of any HTTP request that preceded it.

To use it, simply call get_correlation_runner in the same way that you call get_test_runner. When you run your main script, the log output will include additional information about which responses contain certain parameter names; this is useful in determining where you might be able to capture parameter values.

Note that the correlating test runner is much slower and more memory-intensive than the normal test runner (not to mention it can produce some gigantic log files). Use this only during development of your scripts, and never for an actual load test!

class webtest.correlate.CorrelationRunner(**variables)

A WebtestRunner that correlates requests and responses.

correlate(filename, request)

Attempt to correlate parameters in the given request to any responses already received for the current webtest file.

run_test_set(test_set)

Overridden from WebtestRunner base class, to record the response for each request.

webtest.correlate.get_correlation_runner(test_sets, before_set=None, after_set=None, sequence='sequential', think_time=500, verbosity='debug', variables={})

Return a TestRunner base class that runs .webtest files in the given list of TestSets, and does correlation of request parameters with responses.

All arguments to this function have the same meaning as their counterparts in get_test_runner, with the possible exception of verbosity–the correlating runner is more verbose, printing certain output about found correlations regardless of the verbosity setting.

Previous topic

webtest.macro

Next topic

webtest.parser