Skip to content

[ENHANCEMENT] Autocomplete for variables from Python variable files #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sintpertmartinez opened this issue May 8, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@sintpertmartinez
Copy link

sintpertmartinez commented May 8, 2025

As descriped in my thread in discussions #429 RobotCode does currently not recognize variables from python variable files for autocomplete.
Example:
Page1.py
class Page1:
element1 = a
element2 = b
Page2.py
class Page2:
element1 = c
element2 = d

Importing these in robot as variables
*** Settings ***
Variables Page1.py
Variables Page2.py

Usage in the test:
doSomething ${Page1.element1}
doSomethingElse ${Page2.element1}
click ${Page2.element2}

Problem:
When coding with RobotCode like this autocomplete does not recognize the variables from the python variable files. When typing e.g.
doSomething ${Page1.}
it does not offer the variables from Page1.py for autocomplete - you have to manually type or copy/paste the variable names.

Requested enhancement
RobotCode recognizes the variables from imported python variable files and makes them available for autocomplete by class name.

Structuring variables as shown above is extremely useful when dealing with large applications with many different pages, each containing many different elements/values specific for each page, while having many similar elements on different pages with different use (e.g. company details with different use).
It massively enhances readability, maintainability, and decreases errors by clearly referencing elements by page.
I used Robot Framework Language Server previously for my project and autocomplete for python variable files was implemented there. It offered a great workflow to work like that - would be great if RobotCode could implement that too :)

@sintpertmartinez sintpertmartinez added the enhancement New feature or request label May 8, 2025
@petr-kus
Copy link

petr-kus commented May 8, 2025

I vote for this! 🙂 Every time I teach a test automation lesson, I wonder why this isn’t already included—it supports the standard Page Object Model (POM) technique.

@d-biehl d-biehl self-assigned this May 8, 2025
@d-biehl d-biehl added this to RobotCode May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants