Which is the best File/folder structure from a performance and best practice point of view

Hi All,
I’ve been a while trying to build different scripts with RF and now i realice that maybe the file/folder structure or the way i grupping keyword, variables or web locators maybe could be improved but i don’t really now how to do it.

Let me explain my project structure:

|__Test_Case_folder (only .robot files with TestCases)
|__Results_folder (report.html, log, etc…)
|__Locators_folder (just a py file with web locators to be used to identify web elements)
|__Variables_folder (a .resource file with all the variables that i need… users, logins, pass, environment, browser…)
|__Keywords__folder (a .resorce file with all the keywords that could be reused between TestCases)

Then inside each TestCase (in Settings) i call:
Resource …/Resources/Variables/Variables.resource

And then inside Variables.resource file (in Settings) i call:
Resource …/Keywords/Keywords.resource
Library SeleniumLibrary

So finally in Keyword.resource (in Settings) i call:
Variables …/Locators/Locator.py

The point is… is there a better way to call each file or library so i can improve performance or fullfill the best practices in RF?

Hi Pablo,

What you have is nice and neat and easy to follow, if I were the resource that followed you into your organisation I wouldn’t change it :+1:

There is no real “best” way to do things because every organisation has different requirements.

The folders Locators, Variables, and Keywords, are all under Resources? If so I would suggest you create an <appname.resource> type file in the Resources folder and in the you just have the resource lines to the other resources and in your test case you just call

Resource …/Resources/appname.resource

Will this be faster or slower? probably not if it is it’ll probably be under a millisecond difference but I think it might make it easier to maintain (I guess this is a form of faster?)

The other advantage to this approach is if you have multiple applications that share some resources but not others for each app you can link in just the resources you need for that application.

Hope that helps,


1 Like

Thanks @damies13 will try your approach cause as you told me, the maintenance could be easier and also it could be easier to manage (in the future) more than one app.

Thanks a lot!!!

1 Like