# Can I use importes Resources by name? How do you do it?

**URL:** <https://forum.robotframework.org/t/can-i-use-importes-resources-by-name-how-do-you-do-it/6249>\
**Category:** Robot Framework\
**Created:** [26 September 2023 08:33 UTC](https://forum.robotframework.org/t/can-i-use-importes-resources-by-name-how-do-you-do-it/6249 "2023-09-26T08:33:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nippsh](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/nippsh/32/3029_2.png) [@nippsh](https://forum.robotframework.org/u/nippsh)\
**Post date:** [26 September 2023 08:33 UTC](https://forum.robotframework.org/t/can-i-use-importes-resources-by-name-how-do-you-do-it/6249/1 "2023-09-26T08:33:11Z")

</div>

Hi, I’m new to Robot Framework and I enjoy it, but I’m having a hard time with this.

For each page I have a resource file e. g. _home.resource_ with my locators, variables and keywords. In my Tests I might be importing multiple resources and I want to be able to do something like: _login.${url}_. You can do something like that with libraries but not with resources and I’m having a hard time keeping everything clean and easy to understand.

My current solution is to name my variables with a prefix e. g. _${HOME.URL}_, \*\* but there must be a better way, no? How do you guys deal with this?

P.S. I was also trying to use yaml files with dictionaries but sometimes I need my variables to be dynamic so that’s not a solution.

P.P.S. I was also thinking about using dictionaries in the resource file but the key value pairs are not tabular which doesn’t look very clean  
e. g.  
_&{login} url=/login title=h1_  
…

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [26 September 2023 11:34 UTC](https://forum.robotframework.org/t/can-i-use-importes-resources-by-name-how-do-you-do-it/6249/2 "2023-09-26T11:34:17Z")

</div>

Hi @nippsh,

You import resource files with the `Resource` keyword just like Libraries are imported with the `Library` keyword.

I previously gave a demonstration of resource files with a working example in this forum post:

> [@Create common robot file for generic actions in robot framework](https://forum.robotframework.org/t/create-common-robot-file-for-generic-actions-in-robot-framework/5150/2):
>
> Hi @bk-user , The section of the documentation you need is here: [2.8.1 Resource files](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#toc-entry-353) You can name the file as .resource or .robot, you import them with the resource keyword in the settings section. I find to syntax highlighting doesn’t work in some editors when you use .resource so I usually use .robot You can also create a base .robot file that includes several .robot files, then you can group the keywords in several .robot files as needed but only have one .robot file to include in your te…

Hope that helps,

Dave.
