With ParallelRequest tests you can run multiple tests in parallel. These tests can use up to two BRIDGE services.

Fill in the fields according to the description below.
FieldDescriptionExample
NameSpecify the name of the test.
HostSpecify the host, the service has been deployed to.localhost
Definitions Service 1 (Control)
Specify the definitions for the service you want to use with ParallelRequests.
Control URL ProtocolSpecify the protocol.HTTP or HTTPS
Control Port

Specify the port of the recipient, e.g. Bridge port or control port of the service you want to send a requests to.

8080 or 29027
Control URL PathSpecify the URL path of the request target, e.g. the Bridge API./bridge/rest/services/xuml/PurchaseOrderExample
Control HTTP Header FileSpecify the path to a file that contains URL headers if necessary.
Definitions Service 2 (SOAP)
Specify the definitions for a second service you want to use with ParallelRequests.
SOAP URL ProtocolSpecify the protocol.
SOAP PortSpecify the port of the recipient, e.g. Bridge port or control port of the service you want to send a requests to.
SOAP URL PathSpecify the URL path of the request target.
SOAP HTTP Header FileSpecify the path to a file that contains URL headers if necessary.
Threads Definitions
Threads Definition File
Specify a path to an XML file that contains the thread definitions. For more details on the contents of this file, refer to Defining Threads below.Default name is ThreadDefinition.xml. This name may be changed.
Request Files
Specify a path to a folder that contains additional request files if necessary. For e.g. POST requests that would be the request body.
Control FilesChange here the folder, where the reference data is stored.
Log DirectoryChange here the folder, where the test action results get stored.

Defining Threads

The actual parallel threads cannot be defined via the Analyzer but you have to define them in a thread definition file manually. The thread definition file is based on XML and has the following structure:

<threadsDefinition>
    <options>                                                                                                                                   
        <ignoreElement value="SessionID" />
        <ignoreElement ... />
        <ignoreAttribute ... />
        ...
    </options>
	<threads>
		<thread>
			<test url=control" name="test1" />
			<test ... />
			...
		</thread>
		<thread>
			<test ... />
			<threads>
				...
			</threads>
			...
		</thread>
	</threads>
</threadsDefinition>

Options

At the beginning of the treads definition, you can define ignore options. These are definitions for the comparison of test results which elements or attributes should be ignored (see also Adding Options to a Test Suite).

Within the options element, you can make the following definitions:

ElementDescriptionAllowed Values / Example
ignoreElementIgnore the XML element defined in attribute "value" on test result comparison.If the specified element or attribute does not exist, nothing happens.

ignoreAttributeIgnore the XML attribute defined in attribute "value" on test result comparison.

Tests

Within a thread you can define again threads.

Tests can have the following XML attributes:

AttributeDescriptionMandatoryAllowed Values / Example
urlReference to the service you want to call with this test. The service details (URL, port, ...) are defined in the ParallelRequest test.(tick)controlTest calls service 1.
soapTest calls service 2.
name

Specify a test name. This name will also be used to name the test error logs and response logs.

If performing a POST request, you need to supply the POST body in an XML file <name>.xml. This file must be stored in folder Request Files as defined in the ParallelRequest test.

(tick)
method
HTTP method. Method POST needs an input file in the source folder. The page BRIDGE:@self was not found  -- Please check/update the page name used in the MultiExcerpt-Include macro

POSTPOST request (default).
GETGET request.
pathSupply an appendix to the service path if necessary.
/sessions
variableSpecify the name of the variable to "store to" or "retrieve from" the variable store. Refer to Working With a Variable Store below for more details.
sessionID
xpath

Specify an XPath expression to extract a value from the request response to store it to the variable store. Refer to Working With a Variable Store for more details.



Working With a Variable Store

You can use a variable store with ParallelRequest tests to pass data from one test to others.

In contrast to e.g. ServiceCommand tests, you can only store one variable value to a variable store with ParallelRequest tests.

  1. One test from the thread definitions stores a value from the test response to the variable store using
    • xpath to extract the value from the response
    • variable to specify the name of the variable and the name of the variable store the value is stored to
  2. A later test replaces placeholders in the request file with values from the variable store using
    • variable to load the variable value from file

    This way, the variable value is used in the request of the second test.

Storing Variables to a Variable Store

Specify xpath and variable in a ParallelRequest test. The value extracted by the XPath expression will be stored in the XML file specified by variable under name of variable.
You need at least one ParallelRequest test with this settings to store a value.

Retrieving Variables From a Variable Store

Specify an existent variable store (<variable>.xml) in one or more subsequent ParallelRequest test to retrieve values that have been previously stored. All occurrences of variables in form of ${variable} in a given request file will be replaced by the value from the variable store.

The following applies if your variable definitions are not consistent:

  • If the variable cannot be found in the variable store, the variable value will be returned as an empty string.
  • If you specify xpath but no variable store can be found, nothing will happen.

Thus, you can only use variable stores with requests that use a request file. You cannot replace path variables of a REST request with values from a variable store.

  • No labels