0

How to setup Visual Studio so that i can run robot framework file? I am able to save files on VS code as .robot. it tries to open up chrome browser as soong as i run below robot code.

*** 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

I tried to run this code using eclipse but it gave error msg "No keyword with name 'Open Connection' found." even though sshlibrary is already installed. this code runs fine on "RIDE" IDE.

1 Answer 1

1

You will need to add a tasks.json (under .vscode) with the following content:

{
    // 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
            }
        }
    ]
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.