Extension Step verifyLinkedContent
Verify all selected links on a page for existence and, optionally, mime-type.
Further, the step can verify that the webserver provides the resources with the correct mime-type.
- Required? yes
- The links to checks
- Required? no, default is Accepts anything.
- Type and subtype that the answer must have, in the classical mime-type notation.
- Required? no
- The description of this test step.
accept follows a subset of the description of the http-accept header in RFC 2616,
simplifying it where possible:
The attribute value takes one or more media-range, separated by a semi-colon.
A media-range is a pair of mime type and subtype separated by a slash. The special subtype * accepts all of subtypes of the named type, and the special media-range */* accepts any mime-type.
The most simple usage of <verifyLinkedContent> is to make sure that the server returns all resources. Note that the simple xpath selects the resources to verify.
In a middle level, <verifyLinkedContent> can also enforce the mime-type returned by the server.
In an example of advanced usage, the xpath selects all images in the page and makes sure that the images are either gif or png.
xpath="//img/@src | //input[@type='image']/@src"