Pass NULL values from the datasheet

Hello,

I’m trying to pass the NULL value to a variable in the API test using the Excel data sheet. Currently, it assumes the value as string “NULL” instead of NULL object. Can anyone help?

Thanks!

When you read the string null, create your object instantiating it to NULL.

String var1
String sheetData
sheetData = 'NULL'
# or sheetData = 'some sensible data'

# Normal ternary operator 
var1 = (sheetData != 'NULL') ? sheetData : null

Thanks a lot! That worked.