swprabhu
7 years agoOccasional Contributor
Enumerations
I am trying to validate enumerations but getting an error(null value) though I have created a map 'kind'. How to resolve
//reading the values from a response which has the output like 1,2,3
def Brep=slurpB.Message.ReturnRows.e.DocPrintBypassPrintSwitch.text()
//created a map for enumeartions
def kind=[ '1' : 'FormatReports', '2':'AllReports', '3': 'Error']
//logging the enumerated value
Brept=kind.Brep
log.info Brept
Output :Null
Expected : enumerated values
What should be done to get the enumerated value
Hi,
You need to use
Brept = kind.get( Brep )
instead of
Brept = kind.Brep