Robotframework 机器人框架不';如果用户定义的关键字与testcase位于同一文件中,则无法看到它们

Robotframework 机器人框架不';如果用户定义的关键字与testcase位于同一文件中,则无法看到它们,robotframework,Robotframework,嗨,我是机器人框架的新手。我尝试在与testcases相同的文件中声明关键字。但是机器人框架没有看到它们。我使用的是robotframework 3.2.2,请告知: *** Settings *** Library SeleniumLibrary *** Variables *** *** Test Cases *** User must sign in to check out [Documentation] This is some basic info about the tes

嗨,我是机器人框架的新手。我尝试在与testcases相同的文件中声明关键字。但是机器人框架没有看到它们。我使用的是robotframework 3.2.2,请告知:

*** Settings ***
Library  SeleniumLibrary

*** Variables ***


*** Test Cases ***
User must sign in to check out
[Documentation] This is some basic info about the test
[Tags] Smoke
    Begin Web Test
    Search for Products
    Select Product from Search Results
    Add product to Cart
    Begin checkout
    End Web Test

*** Keywords ***
Begin Web Test
    Open Browser  about:blank  ie

Search for Products
    Go To   http://amazon.com
    Wait Until Page Contains  Today's Deals
    Input Text  Ferrari 458
    Click Button  xpath=//*[@id="nav-search-submit-text"]/input
    Wait Until Page Contains  results for "Ferrari 458"

Select Product from Search Results
    Click Link  xpath=//*[@id="search"]/div[1]/div[2]/div/span[3]/div[2]/div[2]/div/span/div/div/div[2]/h2/a
    Wait Until Page Contains  Back to results

Add product to Cart
    Click Button  id=add-to-cart-button
    Wait Until Page Contains  Added to Cart

Begin checkout
    Click Link  Proceed to checkout (1 item)
    Wait Until Page Contains  Continue

End Web Test
    Close Browser

[文档]
[标签]
需要缩进

[文档]
和“这是有关测试的一些基本信息”之间至少应有2个空格

[Tags]
和烟雾之间至少应有2个空格

User must sign in to check out
   [Documentation]  This is some basic info about the test
   [Tags]  Smoke
   Begin Web Test
   Search for Products
   Select Product from Search Results
   Add product to Cart
   Begin checkout
   End Web Test

未找到名为“这是有关测试的一些基本信息”的关键字?你复制并粘贴了我输入的代码块了吗?它需要缩进抱歉我试着自己打字。你的代码解决了我的问题。谢谢你别担心,我没说清楚。我试图更好地格式化它,所以我需要安装更新版本的seleniumlibrary。因为它是马车。我安装了3.3.1版。现在,甚至自动完成也可以在Pycharm中工作。pip安装机器人框架seleniumlibrary==3.3.1