IntelliSense underlining global variables between .robot files

I have a couple global variables that are being flagged as undefined and global simultaneously.

I have one main robot that invokes tasks and several smaller robots and their keywords.
image
image

The problem with the variables is only happening in the invoked robots where I do not perform
“Import Variables” and “Set Global Variable” methods.

Any ideas why this is happening and how to fix it?

Are there any best practices for using global variables? Storing the variables in a .py file seems a bit sloppy.

(Edits : Sorry I kept messing up the screen shots :frowning: )

Your globalvariables.py needs to be declared in the settings section then those variables are able to be used throughout. Like this

*** Settings ***
Variables   globalvariables.py

The keyword Set Global Variable is used to set global variables declared in the *** Variables *** section.

1 Like

This topic was automatically closed 8 hours after the last reply. New replies are no longer allowed.