# Common Resource file usage for multiple RF projects in eclipse

**URL:** <https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750>\
**Category:** Robot Framework\
**Created:** [22 September 2020 07:13 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750 "2020-09-22T07:13:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apoorva1](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@Apoorva1](https://forum.robotframework.org/u/Apoorva1)\
**Post date:** [22 September 2020 07:13 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750/1 "2020-09-22T07:13:20Z")

</div>

Hi All,

We are trying to have a common resource file and locator file.py which can be used across multiple RF projects in eclipse. So, we tried placing the resource file in a location outside the eclipse project’s directory and tried to use the same in a RF project.

After importing the resource file, it is showing us a warning that,

- RED does not support importing resources located outside of workspace. Keywords from this resource will not be recognized. Try to use Quick Fix (Ctrl+1) to link folder into the project.
- Path ‘C:/RobotCommon/CommonUpointKeywords.resource’ points to location outside your workspace
- Path ‘C:/RobotCommon/CommonUpointKeywords.resource’ is absolute. It is preferred to use relative paths.

![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/1X/79b5571cf0657dfe79446e4e3a05d15dda064880.png)  
Not able to do the Quick Fix in order to link this to the project.

Is there any way to have the common resource file used with all the keywords being recognized in the Test Suite?

Thanks!

---

<div class="post-metadata">

**Author:** ![katch](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@katch](https://forum.robotframework.org/u/katch)\
**Post date:** [22 September 2020 08:22 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750/2 "2020-09-22T08:22:51Z")

</div>

From the error it looks like you need to create a symbolic link to the external folder inside your working project. I think that should fix the error._(Note: I am not using eclipse so its more of a guess 🙂 )_

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [22 September 2020 11:33 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750/3 "2020-09-22T11:33:46Z")

</div>

Put shared resource files into separate git repository and add that new repository as git submodule or subtree (or any similar tooling that allows combining multiple git repos into single checkout).

---

<div class="post-metadata">

**Author:** ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)\
**Post date:** [23 September 2020 17:45 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750/4 "2020-09-23T17:45:49Z")

</div>

We do migrate common resource files to a library in a separate python project with its own lifecycle.  
Our pipeline deploy such libraries in to our own pypi storage on Sonatypr Nexus from where all our python environments can pull python dependencies.

Robot projects then only need to pull the common resource library from nexus.

The benefit of a library with an own lifecycle is that all your projects can rely on different versions of your common resource. If you copy a resource file in to every project, every project must be adapted in case of changes.

---

<div class="post-metadata">

**Author:** ![GegX](https://avatars.discourse-cdn.com/v4/letter/g/90db22/32.png) [@GegX](https://forum.robotframework.org/u/GegX)\
**Post date:** [9 November 2020 11:50 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750/5 "2020-11-09T11:50:03Z")

</div>

is this lib then installed via pip?  
Did you manage to use the auto code completion feature with imported lib?  
I need to set an absolute path eg Resource …/…/…/venv/lib64/python3.9/site-packages/KeywordLibrary/

in order to get this working.

---

<div class="post-metadata">

**Author:** ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)\
**Post date:** [9 November 2020 16:10 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750/6 "2020-11-09T16:10:52Z")

</div>

Yes, all works.

Auto completion depends on your ide. If done right, your keyword should be imported like any other library:

```python
***settings***
Library Keyword library

```

If you must relative path, it either means your library is not in pythonpath (like installed to the wrong python env).

Or maybe your library module has a different name than the library class.

In your library it think the folder structure must be:

- (folder) KeywordLibrary  
– (file) KeywordLibrary.py  
— (class) KeywordLibrary

If anything has a different name your reference to the library is somehow different (but not comprehensive for me).

---

<div class="post-metadata">

**Author:** ![MatteoB](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@MatteoB](https://forum.robotframework.org/u/MatteoB)\
**Post date:** [7 December 2021 11:30 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750/7 "2021-12-07T11:30:32Z")

</div>

Hi Noordsestern,  
To be clear when you write “We do migrate common resource files to a library” you mean you write first the framework resources files in Robot Syntax (high level keywords) and then you convert the resources files into phyton files in phyton programming language?  
Is there any way to do this work in an automatic way?  
Of course with this you gain the advantage to handle the library as described.  
My question is: if so you do write the code “twice”? Wouldn’t it better to write first in python? And what if robotframework resources is written by someone who does not know phyton programming language?

Thank you

---

<div class="post-metadata">

**Author:** ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)\
**Post date:** [7 December 2021 20:25 UTC](https://forum.robotframework.org/t/common-resource-file-usage-for-multiple-rf-projects-in-eclipse/750/8 "2021-12-07T20:25:05Z")

</div>

Hi @MatteoB ,

Yes, you are right: we write the functionality twice. But we only implement keywords twice, if we have more than project for the keyword. Most keywords remain in robot.

It is a question of skill distribution in your team. If you have only few python developers at hand, you have to think about how not to move too much logic in to python, otherwise non-python testers lose traction.

If you have many python developers, of course you can start with python keywords directly.

So it depends what you find as most efficient in your individual setup.

Regards,  
Markus
