COREVALIDATEVARIABLELIB
Use this function library to validate the values/elements stored in variables (referred to as verification points) in a flow. The library covers validation routines for string and XML elements in the variables. It includes all the functions of the WSVALIDATELIB, except that the functions in this library work on the values/elements stored in variables instead of a response to component request in flow run.
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 the XML string stored in a variable are not null. The xpath to be verified needs to be provided in the value column in the pre/post validations sections. If the value is null, this function validation will fail the flow run.
Usage:
elementListNotNull(String variableName, String xPath)
elementNotNull(gVarVariable,contact/mobileNumber)
 
Input Parameters:
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
xpath - xpath of the element to be validated. To be provided in the Value column of test data. Return Type: void
elementListNull
Verifies if all the elements with the specified xpath are null in the XML string stored in a variable. The xpath to be verified needs to be provided in the value column in the pre/post validations sections. If the value is NOT null, this function validation will fail the flow run.
Usage:
elementListNull(String variableName, String xPath)
elementNotNull(gVarVariable,contact/mobileNumber)
 
Input Parameters:
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value1 column.
xpath - xpath of the element to be validated. To be provided in the Value column of test data.
Return Type: void
validateXpathOccurrenceCount
Verifies if the specified xpath occurs the specified number of times in the XML string stored in a variable. The xpath to be verified needs to be provided in the value 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.
Usage:
validateXpathOccurenceCount (String xpath,String VariableName, String expectedCount) validateXpathOccurenceCount(contact/mobileNumber,20)
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the Value column of test data.
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
expectedOccurrenceCount - The expected number of occurrences needs to be specified in the Value column.
 
Return Type: void
elementNotNull
Verifies if the specified element in the XML string stored in a variable is null. This function fails the flow run if the specified element is found to be null in the response.
Usage:
elementNotNull(String xpath, String VariableName)
elementNotNull(mobileNumber)
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
 
Return Type: void
elementIsNull
Verifies if the specified element in the XML string stored in a variable is not null.
Usage:
elementIsNull(String xpath, String variableName)
elementIsNull(mobileNumber)
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
 
Return Type: void
elementValueEquals
Verifies if the specified element value in the XML string stored in a variable is equal to the provided value. The functions fails the flow if the value does not match.
Usage:
elementValueEquals(String xpath,String variableName, String expectedValue)
elementValueEquals(mobileNumber,gVarVariable, "1234567890")
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections.
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
expectedValue - The value to be compared to for validation.
 
Return Type: void
elementValueNotEquals
Verifies if the specified element value in the XML string stored in a variable is not equal to the provided value. The functions fails the flow if the value matches.
Usage:
elementValueNotEquals(String xpath,String variableName, String expectedValue)
elementValueNotEquals(mobileNumber,gVarVariable, "1234567890")
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections.
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
expectedValue - The value to be compared to for validation
 
Return Type: void
elementValueGreaterThan
Verifies if the specified element value in the XML string stored in a variable is greater than the provided value. This function fails the flow if the value is not greater than the specified value.
Usage:
elementValueGreaterThan(String xpath, String variableName String valueToCompare)
elementValueGreaterThan("count",gVarVariable,"5")
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections.
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
valueToCompare - The value to be compared to for validation. To be provided in the Value column.
 
Return Type: void
elementValueGreaterThanEqualTo
Verifies if the specified element value in the XML string stored in a variable is greater than or equal the provided value. The function fails the flow if the value is not greater than or equal to the specified value.
Usage:
elementValueGreaterThanEqualTo(String xpath, String variableName String valueToCompare) elementValueGreaterThanEqualTo("count",gVarVariable,"5")
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
valueToCompare - The value to be compared to for validation. To be provided in the Value column.
 
Return Type: void
elementValueLesserThan
Verifies if the specified element value in the XML string stored in a variable is less than the provided value. The functions fails the flow if the value is not less than the specified value.
Usage:
elementValueLesserThan(String xpath, String variableName String valueToCompare)
elementValueLesserThan("count",gVarVariable,"5")
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
valueToCompare - The value to be compared to for validation. To be provided in the Value column
 
Return Type: void
elementValueLesserThanEqualTo
Verifies if the specified element value in the XML string stored in a variable is lesser than or equal the provided value. The functions fails the flow if the value is not greater than or equal to the specified value.
Usage:
elementValueLesserThanEqualTo(String xpath, String variableName String valueToCompare) elementValueLesserThanEqualTo("count",gVarVariable,"5")
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
valueToCompare - The value to be compared to for validation. To be provided in the value column
 
Return Type: void
elementContains
Verifies if the specified element contains the specified value in the XML string stored in a variable. The function fails the flow if the element does not contain the specified value.
Usage:
elementContains(String xpath,String varibleName, String valueToCompare) elementContains("batchName",gVarVariable, "F1-BILLING)
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
valueToCompare - The value to be compared to for validation. To be provided in the Value column
 
Return Type: void
elementNotContains
Verifies if the specified element does not contain the specified value in the XML string stored in a variable. The function fails the flow run if the element contains the specified value.
Usage:
elementContains(String xpath,String varibleName, String valueToCompare) elementContains("batchName",gVarVariable, "F1-BILLING)
 
Input Parameters:
xpath - xpath of the element to be validated. To be provided in the value column of test data in the pre/post validations sections
variableName - Name of the variable that holds the XML string to be validated. The variable name needs to be provided in the Value column.
valueToCompare - The value to be compared to for validation. To be provided in the Value column
variableNotContains
Verifies if the specified value or element is not available in the XML string held in the variable. The function fails the flow run if the element contains the specified value.
Usage:
reponseNotContains(String variableName,String valueToCompare)
reponseNotContains(gVarVariable,"Failed")
 
Input Parameters:
variableName - the name of the variable that holds the XML string. valueToCompare - value to compare to
 
Return Type: void
variableContains
Verifies if the specified value or element is available in the XML string held in a variable. The function fails the flow run if the element does not contain the specified value.
Usage:
responseContains(String variableName,String value)
responseContains(gVarVariable,"Exception")
 
Input Parameters:
variableName - the name of the variable that holds the XML string. valueToCompare - value to compare to
Return Type: void