Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 572
Chris Curvey Avatar asked Aug 01 '11 15:08

Chris Curvey


People also ask

How do you pass an empty argument in Robot Framework?

If you need to explicitly handle empty spaces as arguments of a keyword, you will need to escape them. Similarly, as when escaping empty values, it is possible to do that either by using the backslash character or by using the built-in variable ${SPACE} .

How do you enter text in robot framework?

Enter Data in TextboxInput Text − This keyword works on the input type and will look for the locator name:search on the site https://www.tutorialspoint.com/ and angularjs is the value we want to type in the textbox. Click button is used to click on the button with location class:gsc-search-button-v2.


2 Answers

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.

like image 191
janne Avatar answered Oct 12 '22 16:10

janne


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

There are many examples, see an example here

like image 11
Manohar Reddy Poreddy Avatar answered Oct 12 '22 16:10

Manohar Reddy Poreddy