WSVALIDATELIB

Use the WSVALIDATELIB function library to validate the test components (referred to as verification points) in the components. The library covers validation routines for string and XML elements in the returned response XML. The function automatically fails or passes a flow run subject to the satisfaction of the specified condition.

This section provides a list of functions in the library, along with the usage details.

elementListNotNull

Verifies if all the elements with the specified xpath in response are not null. The xpath to be verified needs to be provided in the Logical Name column in the pre/post validations sections. If the value is null, this function validation will fail the flow run.

Example:

elementListNotNull(String xPath) 
elementNotNull(contact/mobileNumber)
 
Input Parameters: 
xPath - xpath of the element whose value needs to be checked.
Return Type: void 

elementListNull

Verifies if all the elements in response with the specified xpath are null. The xpath to be verified needs to be provided in the Logical Name column in the pre/post validations sections. If the value is NOT null, this function validation will fail the flow run.

Usage:

elementListNull(String xPath) elementNotNull(contact/mobileNumber)
 
Input Parameters: 
xPath-  xpath of the element whose value needs to be checked.
 
Return Type: void

validateXpathOccurrenceCount

Verifies if the specified xpath occurs the specified number of times in the response. The xpath to be verified needs to be provided in the Logical Name column in the pre/post validations sections. The function counts the number of occurrences of the xpath and will fail the flow run, if the count in the response doesn't match the specified number. The expected number of occurrences should be specified in the Value1 column.

Usage:

validateXpathOccurenceCount (String xpath,String expectedCount)
 

Example:

validateXpathOccurenceCount(contact/mobileNumber,20)
 
Input Parameters: 
xpath - xpath of the element whose occurrence count needs to be checked.
expectedCount - the expected count of occurrences of the element
Return Type: void

elementNotNull

Verifies if the specified element in response is null. The xpath to be verified needs to be provided in the Logical Name column in the pre/post validations sections. This function fails the flow run if the specified element is found to be null in the response.

Usage:

elementNotNull(String xpath)
 

Example:

elementNotNull(mobileNumber)
 
Input Parameters: 
xpath - xpath of the element whose value needs to be checked.
 
Return Type: void

elementIsNull

Verifies if the specified element in response is not null.

Usage:

elementIsNull (String xpath)
 

Example:

elementIsNull (mobileNumber)
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
Return Type: void

elementValueEquals

Verifies if the specified element value in response is equal to the provided value.

Usage:

elementValueEquals(String xpath, String expectedValue)
 

Example:

elementValueEquals(mobileNumber, "1234567890")
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
expectedValue - the expected value to be compared to for validation
 
Return Type: void

elementValueNotEquals

Verifies if the specified element value in response is not equal to the provided value.

Usage:

elementValueNotEquals(String xpath, String expectedValue)
 

Example:

elementValueNotEquals (mobileNumber, "1234567890")
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
expectedValue - the expected value to be compared to for validation
 
Return Type: void

elementValueGreaterThan

Verifies if the specified element value in response is greater than the provided value.

Usage:

elementValueGreaterThan(String xpath, String valueToCompare)
 

Example:

elementValueGreaterThan("count","5")
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
valueToCompare - the expected value to be compared to for validation
 
Return Type: void

elementValueGreaterThanEqualTo

Verifies if the specified element value in response is greater than or equal to the provided value.

Example:

elementValueGreaterThanEqualTo(String responseTag,String valueToCompare)
elementValueGreaterThanEqualTo("totalRecords", "50")
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
valueToCompare - the expected value to be compared to for validation
 
Return Type: void

elementValueLesserThan

Verifies if the specified element value in response is less than the provided value.

Usage:

elementValueLesserThan(String xpath,String valueToCompare)
 

Example:

elementValueLesserThan ("counter", "50")
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
valueToCompare - the expected value to be compared to for validation
 
Return Type: void

elementValueLesserThanEqualTo

Verifies if the specified element value in response is less than or equal to the provided value.

Example:

elementValueLesserThanEqualTo(String xpath,String valueToCompare)
 

Usage:

elementValueLesserThanEqualTo ("attempts", "10")
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
valueToCompare - the expected value to be compared to for validation
Return Type: void

elementContains

Verifies if the specified element is available in the response.

Usage:

elementContains(String xpath,String valueToBeChecked)
 

Example:

elementContains("batchName", "F1-BILLING)
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
valueToBeChecked - the expected value to be compared to for validation
 
Return Type: void

elementNotContains

Verifies if the specified element is not available in the response.

Usage:

elementNotContains(String xpath, String valueToBeChecked)
 

Example:

elementNotContains ("description", "billing")
 
Input Parameters: 
Xpath - xpath of the element whose value needs to be checked.
valueToBeChecked - the expected value to be compared to for validation
 
Return Type: void

reponseNotContains

Verifies if the specified value or element is not available in the response.

Usage:

reponseNotContains(String value)
 

Example:

reponseNotContains("Failed")
 
Input Parameters: 
value - the value to be compared to for validation
 
Return Type: void

responseContains

Verifies if the specified value or element is available in the response.

Usage:

responseContains(String value)
 

Example:

responseContains("Exception")
Input Parameters: 
value - the value to be compared to for validation
 
Return Type: void