在我的测试用例中,我试图比较
'Content-type "application/pdf" is not supported'
是否存在。
这是我得到的错误:
Evaluating expression '"Content-type "application/pdf" is not supported" != ""' failed: SyntaxError: invalid syntax (, line 1)
我的关键字表达式是:
Run Keyword If "${failure_message}" != "${EMPTY}" My Click Element id=btn_import_cancel
最佳答案
Robot 允许您通过省略大括号在不带引号的表达式中使用变量。
run keyword if $failure_message != "" My Click Element id=btn_import_cancel
如需更多信息,请参阅 Evaluating Expressions在内置库文档中。
关于robotframework - 如果字符串中存在双引号,如何比较 Robot Framework 中的两个变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46741949/