Forum Discussion

maurus_spescha's avatar
maurus_spescha
Occasional Contributor
11 years ago

How can I include resources into a keyword test?

Hi,



I would like to include resources like external dll, properties files etc. into a keyword test.



How could I do that?

6 Replies

  • Hi Maurus.



    Try to create your custom catalogue in project home directory (where you may store any data you want).

    Use  Project.Path property as home directory (relative file addressing makes your project portable).

    Using this approach I store my customized logs and archives (which are related to specific project). If I move or copy project to new location, all file addressing schemas work without issue (e.g. TC understands relatively addressed Excel data sources for data driven loops).



    For example, my project-specific excel full file name looks like this:



    var WorkbookName = Project.Path + "Stat\\" + fileNaming() + ".xlsx";

    // fileNaming() is my file name generation function.



  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Maurus, have you tried using the Stores|Files Collection to store your files?



    You can then use the Files object to access the stored files.




    From your second post, this seems to match your requirements.


     


    Regards,


    Phil Baird

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    What do you intend to do with those resources?  Your intention of how they are to be utilized within the keyword test will determine the possibilities of how to utilize them, if they can be.
  • maurus_spescha's avatar
    maurus_spescha
    Occasional Contributor
    Hi,



    thanks for your replay.



    I would like to store everything I need for my tests in the project suite.



    An example:



    One of my test does an import of data. The data is stored in a file and I would like to store the data file in the project suite.



    In this way everything the test needs to run is at one place.



    So I do nothing with the things stored in resources. The resources might be used by a test or not.
  • Catalogue can be created manually using OS tools (New Folder) directly in project structure. Actually this catalogue is not visible in your TC project explorer directly, this is why I called it "custom". In addition, all the files you need should be placed into this catalogue manually.