当我运行这段代码时,它显示${month} not found,${month status}返回True
${month status}= Run Keyword and Return Status Element Should Be Visible xpath=//div[@data-title='Cost for Month']
Run Keyword If '${month status}' == 'True'
... ${month}= Get Text xpath=//div[@data-title='Cost for Month']
... Log Dashboard is displaying ${month} Cost Usage for month Text
... ELSE
... Fail Cost Dashboard is not displaying Cost Usage for month Text发布于 2016-01-08 23:35:58
${month status}= Run Keyword and Return Status Element Should Be Visible xpath=//div[@data-title='Cost for Month']
${month}= Run Keyword If '${month status}' == 'True' Get Text xpath=//div[@data-title='Cost for Month']
Run Keyword If '${month status}' == 'True' Log Dashboard is displaying ${month} Cost Usage for month Text
Run Keyword If '${month status}' == 'False' Fail Cost Dashboard is not displaying Cost Usage for month Text有点粗糙的解决方案,但我们也遇到了这种情况,并使用上面的修复程序解决了它。
我认为您的代码失败是因为${month}被解释为关键字而不是变量。
https://stackoverflow.com/questions/33383880
复制相似问题