Skip to content

[ENHANCEMENT] Autocomplete for Python Variables objects attributes #558

@angel-valdezzz

Description

@angel-valdezzz

Hi! — thanks for the extension, it’s been really useful.

I’m using Python variable files to group related values (UI locators, config, constants) into objects, and then access them in Robot Framework like:

  • ${LOGIN_PAGE.username}
  • ${ENV.base_url}
  • ${STATUS.active}

Right now I don’t get autocomplete suggestions after typing:

  • ${LOGIN_PAGE.
  • ${ENV.

Example

# variables/ui.py
class LoginPage:
    username = "id=username"
    password = "id=password"
    submit_button = "id=loginBtn"

LOGIN_PAGE = LoginPage()

class Env:
    base_url = "https://qa.example.com"
    timeout_seconds = 10

ENV = Env()
*** Settings ***
Variables    ../variables/ui.py
Library      SeleniumLibrary

*** Test Cases ***
Example
    Open Browser    ${ENV.base_url}    chrome
    Input Text      ${LOGIN_PAGE.username}       demo
    Input Text      ${LOGIN_PAGE.password}       secret
    Click Button    ${LOGIN_PAGE.submit_button}

Autocomplete suggestions for attributes like:

  • username, password, submit_button
  • base_url, timeout_seconds

Do you think this would be feasible to support?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions