2013/1/18 <
leslie...@rd.io>:
>
> 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?
Kevin already showed how to do this by using BuiltIn library programmatically.
> 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
>
> test.txt:
>
> ***Settings***
> Library logger
> ...
>
> logger.py:
>
> results_path = os.environ["RESULTS_PATH"]
> # other set up stuff
I don't actually see anything wrong with this approach. If you need to
access those environment variables also in test data, you can do that
directly using %{RESULT_PATH} syntax. One benefit of this approach is
that your Python code is not dependent on Robot Framework. It is also
sometimes pretty handy that possible child processes started by your
tests automatically see these environment variables.
Cheers,
.peke
--
Agile Tester/Developer/Consultant ::
http://eliga.fi
Lead Developer of Robot Framework ::
http://robotframework.org