Hi Robot Users,
Have a question on something I haven't been able to resolve. The setup I have, is a directory called resource/, which holds all the robot keywords I am using. I'm finding out, as I add new products to test however, that many are common and can use the same keywords, but some are not. So what I would like to do is have the ability to have a common resource directory, and then say a directory for each product which contain specific keywords for that product.
Example:
resource/
common/
common_resource.robot
network.robot
other_resource.robot
product1/
network.robot
product2/
some_resource.robot
Now let's say that common and product1 files network.robot both have a keyword that is called 'Get Network Info'. On most products, I'm expecting this keyword to work without changes, however, product1 is vastly different.
So my question is, let's say I import my resource files based on product name, that is, product1, product2, etc.. but regardless of the product, I still import common. What I would like to do is somehow take any keywords from product one and override any duplicates in common, so that IF there is a duplicate, I know that I need to use it from product1, not common.
The reasoning behind this is to avoid lengthy conditionals in resource keywords, (i.e. if product 1 do this, elif product2 do this, elif product3 do this... and so on).
Hopefully this makes sense, and hoping that some of you may have some suggestions on how to approach this. I can easily overwrite the common file to just remove the duplicated keyword from other product, but I'm guessing there is a better way.
Thanks all in advance!
Andy