19

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 Value Should Be       identifier=name1       Chris
Textfield Value Should Be       identifier=name2

I want to test that name2 is blank. I have tried leaving it blank (which returns a message about an incorrect number of arguments. I have tried "", which looks for a pair of quotes, and '' which enters a single quote, and selenium seems to look for that

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
Chris Curvey
  • 9,738
  • 10
  • 48
  • 70

3 Answers3

32

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.

Bence Kaulics
  • 7,066
  • 7
  • 33
  • 63
janne
  • 1,007
  • 6
  • 8
11

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

There are many examples, see an example here

Bence Kaulics
  • 7,066
  • 7
  • 33
  • 63
Manohar Reddy Poreddy
  • 25,399
  • 9
  • 157
  • 140
0

${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.

Giovanni Di Toro
  • 797
  • 1
  • 14
  • 34
Alonna
  • 1