Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9159595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:31:54+00:00 2026-06-17T13:31:54+00:00

I have some settings-type global vars that I’d like to be able to access

  • 0

I have some settings-type global vars that I’d like to be able to access from Python code. For example:

pybot --variable RESULTS_PATH:/wherever/this/points test.txt

Now, my module logger.py file needs to know the results_path to set up properly.

I know that I can initialize the logger with a variable, like

***Settings***
Library  logger  ${RESULTS_PATH}

And then in logger I’ll be passed results_path:

 def __init__(self, results_path):
   # Whatever

However the problem with doing it this way for me is that I want to access and use the logger from both Python code and within test cases. So if I set it up this way, if I want to use the logger from Python code I run into the same problem of needing results_path to initialize the logger properly.

Are there any functions in the robot framework library that would allow me to grab the value of ${RESULTS_PATH} from Python code? What is the proper way to do something like this?

Right now, my workaround for the issue is to set RESULTS_PATH as an environment variable. So I have something like:

Run like:

RESULTS_PATH=/wherever/this/points pybot test.txt

File test.txt:

***Settings***
Library  logger
...

File logger.py:

results_path = os.environ["RESULTS_PATH"]
# Other set up stuff
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:31:55+00:00Added an answer on June 17, 2026 at 1:31 pm

    You will want to use rf’s BuiltIn library, for reference read the documentation as found here. This provides the keywords that are built into Robot Framework and so should reliably stay usable:

    from robot.libraries.BuiltIn import BuiltIn
    results_path = BuiltIn().get_variable_value("${RESULTS_PATH}")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some python code using shutil.copyfile: import os import shutil src='C:\Documents and Settings\user\Desktop\FilesPy'
I have some application settings that I'd like to add to my configuration file,
I have some settings in my app.config which I intend to be 'global' -
So I have some settings that are of the user scope, but for some
I have a string ($c) that contains a comma-separated list of settings. Some settings
I have an app that has some configuration settings stored in SharedPreference. Now I
I have some code that locates all the contact folders that a user has
I have some models like that: class BaseModel(models.Model): created_by = models.ForeignKey(User, related_name=%(app_label)s_%(class)s_created) created_date =
I have added some settings to my c# application using the configuration editor. There
In the settings.php i have some input for the realname,hobby,city and select tag for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.