使用robotframework-selenium时如何测试空白文本字段? [英] How to test for blank text field when using robotframework-selenium?
问题描述
在将robotframework-selenium库与TSV文件一起使用时,如何为文本字段指定空白/空值?例如,我有以下内容:
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
我要测试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
推荐答案
您可以使用单个反斜杠\或特殊变量$ {EMPTY}在测试数据中创建一个空字符串.用户指南中包含以下详细信息: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html
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: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html
这篇关于使用robotframework-selenium时如何测试空白文本字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!