Search code examples
robotframeworkjsonpath

How to ignore None value from list?


I am testing BE and when getting json path for some values I get None. I want to ignore them. Remove values from list did not work for me.

Remove values from list  ${list}    None/${empty}/null

Are there any other ways to ignore None value?

enter image description here

I also tried to get from json values without null but did not work either. Showed an error

JsonPathLexerError: Error on line 1, col 41: Unexpected character: ?

${TARGET_TEXT}=    Get Json Path    ${RESPONSE}    $.pipelines..filter.children..targetText[?!@.None]

Solution

  • You're close. You need to remove ${NONE} rather than ${EMPTY}

    Remove values from list  ${TARGET_TEXT}  ${NONE}