Skip to content

[BUG] Using variables from Python files in Robot Framework does not navigate to the correct line #428

Open
@M-HALLIDAY

Description

@M-HALLIDAY

Describe the bug
Some variables are defined in a Python file, and the file is imported in the *** Variables *** section of a Robot Framework file. When clicking on a variable in *** Test Cases ***, it does not navigate to the corresponding line in the Python file.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Create a Python variables file, e.g., test.py.
  2. Import the Variables file in the Robot file.
  3. Hover over the variable name—the variable value is displayed.
  4. Press Ctrl + Left Click.
  5. The cursor jumps to the Python file but defaults to the first line instead of the line where the variable is defined.

test.py

# encoding=utf-8

ip="10.1.100.1"
name="centos7"

test.robot

*** Settings ***
Variables         ./test.py 

*** Test Cases ***
00_TEST
    [Setup]
    log    ${ip}
    Log    ${name}

Screenshots/ Videos
step3:Hover over the variable ${ip} —the variable value is displayed.
Image

When clicking on the variable ${ip}, it should navigate to the third line.
Image

Desktop (please complete the following information):

  • VS Code Version 1.99.2
  • RobotCode Version 1.0.3
  • OS: Windows
  • Python Version 3.8.10
  • RobotFramework Version 6.1.1
  • Additional tools like robocop, robotidy

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions