【问题标题】:In robot framework Can we use Element Should Be Visible in Run Keyword If在机器人框架中我们可以使用元素应该在运行关键字中可见吗
【发布时间】:2018-12-03 14:15:54
【问题描述】:

我正在使用此代码:

Run Keyword If Element Should Be Visible    ${PO_Mail_Subject}

我正在使用 Element Should Be Visible in Run Keyword If 并获取 Evaluating expression 'Element Should Be Visible' failed: SyntaxError: invalid syntax (<string>, line 1)

我不知道我的代码是否有效。谁能帮帮我!!

【问题讨论】:

  • 我的要求是验证主题内容是否存在(如果存在)我将验证该邮件的内容,或者我将迭代以获取主题中包含特定文本的邮件并打开邮件,然后我将验证该邮件内容。
  • 欢迎来到Stack Overflow。请不要使用 cmets 获取对您的问题至关重要的信息,而是使用 edit 功能更新您的问题。

标签: robotframework selenium2library


【解决方案1】:

这样试试:

${Status}=    Run Keyword And Return Status     Element Should Be Visible ${PO_Mail_Subject}
Run Keyword If    '${Status}'=='TRUE'     Element Text Should Be    <Locator>    <Mail Content>    ELSE    < Do iteration Operation>

【讨论】:

    猜你喜欢
    • 2015-08-11
    • 2018-11-27
    • 2021-04-16
    • 2017-10-13
    • 2020-11-06
    • 2017-09-26
    • 2018-07-23
    • 1970-01-01
    • 2022-10-25
    相关资源
    最近更新 更多