I am using Robotframework and CSVLibrary to write randomly generated strings. Error while writing into CSV . The following is the code,
${datalist} CREATE LIST
${list}= getmandatory test.xml testInfo
: FOR ${a} IN @{list}
\ ${random}= String.Generate Random String ${a.maxlength} [UPPER]${a.format}
\ append to list ${datalist} ${random}
log to console ${datalist}
append to csv file data.csv ${datalist}
The getmandatory is a python pgm wshich returns me a list of all mandatory fields in a given xml. The list values are randomly generated strings , ['BDSVRtZEISBGItUtUMYHBULtUEZQTtDOCBFUGJAPWHXtIeYKTUAWOLSPFBXQCDWLtTIPtOJFTBXSUAYMMNtPRRFMQZGXKBUAtIFD', 'DHeSR']
I am getting an error ,
TypeError: a bytes-like object is required, not 'str'
I am not sure what I am doing wrong here . Please help !