Latka XML Reference

byteLength

validates the length of an HTTP(S) response

DTD

<!ELEMENT byteLength EMPTY>
<!ATTLIST byteLength min   CDATA "0"
                     max   CDATA #IMPLIED
                     label CDATA #IMPLIED>

Attributes

NameTypeDefaultDescription
minNUMBER0 Minimum number of bytes required for a valid response. Implied. Defaults to 0.
maxNUMBERnone Maximum number of bytes required for a valid response. Optional. When absent, there is no upper limit on the number of bytes in a valid response.
labelCDATAnone Label associated with this validation, which may be used in programatically generated documentation or reports. Optional.

Parents

Description

A byteLength validation passes if the HTTP(S) response is at least min bytes long, and (when specified) at most max bytes long.

cookie

validates the presence of an HTTP(S) cookie in a response

DTD

<!ELEMENT cookie EMPTY>
<!ATTLIST cookie name  CDATA #REQUIRED
                 value CDATA #IMPLIED
                 label CDATA #IMPLIED>

Attributes

NameTypeDefaultDescription
nameCDATAnone, but required The name of the cookie to look for. Required.
valueCDATAnone, optional The value that the cookie with the specified name should have (if any).
labelCDATAnone Label associated with this validation, which may be used in programatically generated documentation or reports. Optional.

Parents

Description

A cookie validation passes if the HTTP(S) response contains a cookie with the specified name. If a value is provided, the cookie must also have the specified value.

credentials

username/password credentials for Basic HTTP authentication.

DTD

<!ELEMENT credentials EMPTY>
<!ATTLIST credentials userName CDATA #REQUIRED
                      password  CDATA #REQUIRED>

Attributes

NameTypeDefaultDescription
userNameCDATAnone, requiredUser name. Required.
passwordCDATAnone, requiredPassword. Required.

Parents

Description

Contains credentials for HTTP Basic Authentication.

maxRequestTime

validates the response time for an HTTP(S) request

DTD

<!ELEMENT maxRequestTime EMPTY>
<!ATTLIST maxRequestTime millis CDATA "30000"
                           message  CDATA #IMPLIED>

Attributes

NameTypeDefaultDescription
millisNUMBER30000 Maximum amount of time, in milliseconds, in which a response must be returned to be considered a valid response. Implied. Defaults to 30000 milliseconds, or 30 seconds.
labelCDATAnone Label associated with this validation, which may be used in programatically generated documentation or reports. Optional.

Parents

Description

A maxRequestTime validation passes if the HTTP(S) response is obtained in no more than millis milliseconds.

param

indicates a request parameter as part of an HTTP(S) request to be executed

DTD

<!ELEMENT request (paramName, paramValue)>

Attributes

None.

Parents

Description

A parameter to be submitted as part of a request.

paramName

the name part of a name/value pair parameter

DTD

<!ELEMENT paramName (#PCDATA)>

Attributes

None.

Parents

Description

The name part of param to be submitted as part of a request.

paramValue

the value part of a name/value pair parameter

DTD

<!ELEMENT paramValue (#PCDATA)>

Attributes

None.

Parents

Description

The value part of param to be submitted as part of a request.

regexp

validates the presence or absence of a regular expression within an HTTP(S) response

DTD

<!ELEMENT regexp EMPTY>
<!ATTLIST regexp pattern    CDATA          #REQUIRED
                 cond       (true | false) "true"
                 ignoreCase (true | false) "false"
                 label       CDATA         #IMPLIED>

Attributes

NameTypeDefaultDescription
patternCDATAnone, but required. The regular expression to look for.
cond Enumeration:
  • true
  • false
true When true, the given pattern must match within the response. When false, the given pattern must not match within the response.
ignoreCase Enumeration:
  • true
  • false
false When true, case is ignored within the given pattern.
labelCDATAnone Label associated with this validation, which may be used in programatically generated documentation or reports. Optional.

Parents

Description

A maxRequestTime validation passes if the HTTP(S) response is obtained in no more than millis milliseconds.

request

indicates an HTTP(S) request to be executed

DTD

<!ELEMENT request (credentials?, param*, validate?)>
<!ATTLIST request path   CDATA        #REQUIRED
                     method (post | get) "get"
                     host   CDATA        #IMPLIED
                     port   CDATA        #IMPLIED
                     label  CDATA        #IMPLIED>

Attributes

NameTypeDefaultDescription
pathCDATAnone, but requiredRequest path. Required.
method enumeration:
  • get
  • post
getHTTP method. Implied. Defaults to get.
hostCDATAnone Host to submit request to. Optional. When absent, uses default from suite.
portNUMBERdepends upon protocol Port to submit request to. Optional. When absent, uses default from suite.
labelCDATAnone Label associated with this validation, which may be used in programatically generated documentation or reports. Optional.

Parents

Description

An HTTP(S) request to be executed.

session

wrapper for a sequence of requests associated with the same state (session)

DTD

<!ELEMENT session (request+)>
<!ATTLIST session sessionId CDATA #IMPLIED
                     label      CDATA #IMPLIED>

Attributes

NameTypeDefaultDescription
sessionIdCDATAnone Unique identifier for this session. Sessions with the same sessionId will share the same underlying state (e.g., cookies, etc.)
labelCDATAnone Label associated with this session, which may be used in programatically generated documentation or reports. Optional.

Parents

Description

A session is a collection of requests that share the same underlying state. For example, a cookie that returned in the response to one request will be included in subsequent requests.

statusCode

validates an HTTP response code

DTD

<!ELEMENT statusCode EMPTY>
<!ATTLIST statusCode code  CDATA "200"
                      label CDATA #IMPLIED>

Attributes

NameTypeDefaultDescription
codeNUMBER200 Numeric HTTP response code to expect. Implied. Defaults to 200.
labelCDATAnone Label associated with this validation, which may be used in programatically generated documentation or reports. Optional.

Parents

Description

A statusCode validation passes if the HTTP(S) response code for the given request matches the value specified by code.

suite

root element for a suite of tests

DTD

<!ELEMENT suite ( (session | request)+ )>
<!ATTLIST suite defaultHost CDATA #IMPLIED
                   defaultPort CDATA #IMPLIED
                   label        CDATA #IMPLIED>

Attributes

NameTypeDefaultDescription
defaultHostCDATAnone Default hostname for requests. Optional.
defaultPortNUMBERnone Default port for requests. Optional.
labelCDATAnone Label associated with this suite, which may be used in programatically generated documentation or reports. Optional.

Parents

None.

Description

A suite is a collection of requests and sessions to execute.

validate

indicates the suite of validations to apply to the current request (and its response)

DTD

<!ELEMENT validate (byteLength | cookie | maxRequestTime | regexp | statusCode | xpath )+>

Attributes

None.

Parents

Description

Contains the set of validations to apply to the current request (and its response).

xpath

xpath - assuming the HTTP(s) response contains XML, checks if an XPath expression matches

DTD

<!ELEMENT xpath EMPTY>
<!ATTLIST xpath select    CDATA          #REQUIRED
                   cond       (true | false) "true"
                   value     CDATA          #IMPLIED
                   label     CDATA          #IMPLIED>

Attributes

NameTypeDefaultDescription
selectCDATAnone An XPath expression, designed to match a node in the XML body of the response.
cond Enumeration:
  • true
  • false
true When true, the given XPath expression must match within the response. When false, the given XPath expression must not match within the response.
value CDATA none, optional The value that the matched node should have, if any.
label CDATA none Label associated with this validation, which may be used in programatically generated documentation or reports. Optional.

Parents

Description

A xpath validation passes if the HTTP(S) response body contains XML, and the specified XPath expression matches (or not, depending on cond)