COREVERIFYCONDITIONVARIABLELIB
This library has been designed to be used in conjunction with the skip component feature of Oracle Utilities Testing Accelerator. 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. The library validates the conditions on the response XML and outputs true or false value, which can be stored into an output global variable.
The functions in this library take a variable holding the response XML as one of the inputs and apply the validation condition on the XML in the variable.
The response of a component step can be stored in to a global variable using the “setReponseIntoVariable” function in the CORERESPONSEUTILLIB.
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 variable holding the response XML and 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 will return false, else it will return true.
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: String (true|false)
elementListNull
Verifies if all the elements with the specified xpath are null in the XML string stored in a variable. The variable holding the response XML and the xpath to be verified needs to be provided in the value columns in the pre/post validations sections. If the value is NOT null, this function will return false, else it will return true..
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: String (true|false)
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 this function will return false, if the count in the response does not match the specified number, else it will return true.
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: string (true|false)
elementNotNull
If the specified element in the XML string stored in a variable is null, then this function will return false, else it will return true.
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: String (true|false)
elementIsNull
If the specified element in the XML string stored in a variable is null, then the function returns true, else it will return false.
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: String (true|false)
elementValueEquals
If the specified element value in the XML string stored in a variable is equal to the provided value, then the function returns true, else it returns false.
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: String {true|false)
elementValueNotEquals
If the specified element value in the XML string stored in a variable is not equal to the provided value, then the function returns true, else it returns false.
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: String (true|false)
elementValueGreaterThan
If the specified element value in the XML string stored in a variable is greater than the provided value, then the function returns true else it returns false.
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: String (true|false)
elementValueGreaterThanEqualTo
If the specified element value in the XML string stored in a variable is greater than or equal the provided value, then function returns true, else it returns false.
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: String (true|false)
elementValueLesserThan
If the specified element value in the XML string stored in a variable is less than the provided value, then the function returns true, else it returns false.
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: String (true|false)
elementValueLesserThanEqualTo
If the specified element value in the XML string stored in a variable is lesser than or equal the provided value, then the function returns false, else it returns true.
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: String (true|false)
elementContains
If the specified element contains the specified value in the XML string stored in a variable, the function returns true. Else, it returns false.
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
If the specified value or element is not available in the XML string held in the variable, the function returns true. Else, it returns false.
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: String (true|false)
variableContains
If the specified value or element is available in the XML string held in a variable, the function returns true. Else, it returns false.
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: String {true|false)