【问题标题】:Robot Frame Work:: Gherkin execution errorRobot Framework:: Gherkin 执行错误
【发布时间】:2018-02-06 03:45:11
【问题描述】:

我写了我的第一个 Gherkin 脚本 (first.robot),运行时我收到 "No keyword with name 'Given' found." 错误。有没有我必须包含的库或者我应该做任何 pip install 什么??

***
Gherkin Style TC
   [Documentation]  Let me try this time
    Given  Environement Setup Ready
    When  Required URL Get Loaded
    Then  Wait For Meters List to Appear
    And  Capture the list of Meters
    Then  CloseBrowser

***

【问题讨论】:

    标签: robotframework gherkin


    【解决方案1】:

    Given(和其他)后面有两个空格,但机器人使用两个空格将关键字与参数分开。 GivenWhen 等后面必须只有一个空格,否则机器人会认为Given 是关键字。

    Gherkin Style TC
         [Documentation]  Let me try this time
         Given Environement Setup Ready
         When Required URL Get Loaded
         Then Wait For Meters List to Appear
         And Capture the list of Meters
         Then CloseBrowser
    

    有些人在给定/何时/那么之前添加额外的空间以使事情整齐排列:

    Gherkin Style TC
         [Documentation]  Let me try this time
         Given Environement Setup Ready
          When Required URL Get Loaded
          Then Wait For Meters List to Appear
           And Capture the list of Meters
          Then CloseBrowser
    

    【讨论】:

    • 哇,伙计。你是解决方案的人..非常感谢。我一直在努力找出自己犯了什么错误。
    猜你喜欢
    • 2020-12-09
    • 2019-06-25
    • 2013-01-31
    • 1970-01-01
    • 2014-03-16
    • 2020-11-23
    • 2022-11-30
    • 1970-01-01
    • 2016-12-16
    相关资源
    最近更新 更多