You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :)
The text was updated successfully, but these errors were encountered:
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.
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 :)
The text was updated successfully, but these errors were encountered: