【问题标题】:how to setup robot framework on Visual Code Studio如何在 Visual Code Studio 上设置机器人框架
【发布时间】:2020-07-07 14:56:06
【问题描述】:

如何设置 Visual Studio 以便我可以运行机器人框架文件?我能够将 VS 代码上的文件保存为 .robot。只要我在机器人代码下运行,它就会尝试打开 chrome 浏览器。

*** Settings ***
Documentation      Robot Framework test script
Library            SSHLibrary

*** Variables ***
${host}            11.11.11.11
${username}        username
${password}        password
${alias}           remote_host_1

*** Test Cases ***
Test SSH Connection
    Open Connection     ${host}        alias=${alias}
    Login               ${username}    ${password}    delay=1
    Execute Command     hostname
    Close All Connections

我尝试使用 Eclipse 运行此代码,但它给出了错误消息“未找到名称为‘打开连接’的关键字。”即使 sshlibrary 已经安装。此代码在“RIDE”IDE 上运行良好。

【问题讨论】:

    标签: robotframework


    【解决方案1】:

    您需要添加一个tasks.json(在.vscode 下),内容如下:

    {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "tasks": [
            {
                "label": "Run robo tests",
                "command": "robot",
                "options": {
                    "cwd": "${workspaceFolder}/<your-folder-containing-yur-tests>"
                },
                "group": {
                    "kind": "test",
                    "isDefault": true
                }
            }
        ]
    }
    

    【讨论】:

      猜你喜欢
      • 2018-04-25
      • 1970-01-01
      • 2016-07-06
      • 1970-01-01
      • 1970-01-01
      • 2015-09-17
      • 2021-07-09
      • 2017-09-12
      • 2019-03-03
      相关资源
      最近更新 更多