Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

contains operator

Syntax

Description

Junos Snapshot Administrator test operator that determines if an XML element string value contains the provided test-string value.

Parameters

err string

Statement generated when the test case returns false.

info string

Description of the test case.

test-string

String searched for in the XML element value. Enclose the string in quotation marks.

xpath-expression

XPath expression selecting the elements to evaluate.

Usage Examples

Given the following partial XML output from the show version operational mode command:

The following test case selects the first package-information node set, and checks the child comment element for a Junos OS release number of 10.4. If the 10.4 release string is not found, the code generates the error message. The error string includes the comment value containing the release number found on that Routing Engine.

Release Information

Operator introduced in Junos Snapshot Administrator Release 1.0.