relative paths

130 views
Skip to first unread message

BS

unread,
Jan 21, 2009, 10:14:07 AM1/21/09
to robotframework-users
hi!

i'm dealing with paths and see some problems here. In Setting table
the curent working directory points to directory of current testcase
file.
In other cases path to the directory from you started pybot (e.g. I'm
trying to open a file in python library).
Why is not not constant?
Also the problem is in testcases (or I missed something) when I use
Library keyword. HEre is my hierarchy:

main: -libs (with libraries)
-testcases:
- testsuit1
- testsuit2:
- subtestsuit1
- subtestsuit2
- testsuit3

So If I have to use Library keyword in subtestsuit1 i have to pass
'../../../libs/library.py' in testsuit3 '../../libs...'
${CURDIR} doesn't fix this issue. Why current dir is not related to
the directory from you started pybot?

Pekka Klärck

unread,
Jan 21, 2009, 10:36:43 AM1/21/09
to xter...@o2.pl, robotframework-users
2009/1/21 BS <xter...@o2.pl>:

We have just defined ${CURDIR} so that it is the directory where the
test data file is, and similarly paths given to Library, Resource and
Variables settings are relative to that directory. Changing this
directory based on where you happen to execute test cases from would
be pretty fragile. These semantics won't change, but it is possible to
add new built-in variable like ${EXECDIR} that is the directory where
tests are executed from. Please submit a feature request if you find
such a variable useful.

In your case if you have all the libraries in one place I recommend
adding that directory to PYTHONPATH either using environment variable
with the same name or --pythonpath option. Then you can take libraries
into use with just a library name without specifying the path to them.

Cheers,
.peke

BS

unread,
Jan 22, 2009, 4:23:42 AM1/22/09
to robotframework-users
On 21 Sty, 16:36, Pekka Klärck <p...@iki.fi> wrote:

> In your case if you have all the libraries in one place I recommend
> adding that directory to PYTHONPATH either using environment variable
> with the same name or --pythonpath option. Then you can take libraries
> into use with just a library name without specifying the path to them.

yeah...

also i opened a new ticket http://code.google.com/p/robotframework/issues/detail?id=214
Reply all
Reply to author
Forward
0 new messages