How to test for blank text field when using robotframework-selenium?

后端 未结 3 1512
耶瑟儿~
耶瑟儿~ 2021-02-13 12:03

How can I specify blank/empty value for a text field when using the robotframework-seleniumlibrary with a TSV file? For example, I have the following:

Textfield          


        
相关标签:
3条回答
  • 2021-02-13 12:49

    Yes, ${EMPTY} is a built in variable.

    There are many examples, see an example here

    0 讨论(0)
  • 2021-02-13 13:00

    You can use either a single backslash \ or special variable ${EMPTY} to create an empty string in the test data. User guide has the details: Robot Framework User Guide.

    0 讨论(0)
  • 2021-02-13 13:07

    ${EMPTY} is good for a blank value but, surprisingly, it didn't work for an empty value.

    I found what I was looking for. The field I was verifying had no value in its value attribute and I wanted to verify it. It was returning '' as the value and when using ${EMPTY} it couldn't find '''' instead. Such a minor thing but ended up solving what I needed, so it depends what you're seeking to verify.

    0 讨论(0)
提交回复
热议问题