Forum Discussion

m_essaid's avatar
m_essaid
Valued Contributor
9 years ago

How to define dynamicaly the Stores\Files folder

Hi,

 

I have a brand new configuration that works pretty well : 

-  testcomplete on my machine (1)

- two hyperv windows on this physical machine (2)

- and the old VM that runs the night. (3)

 

the elements 1 and 3 never works simultaneously, so they use the same project suite folder.

 

the two hyperV are used to run simultaneously with the machine 1, so I make copies of the whole project (except useless files) everytime I launch a test run.

 

the problem is that when I use this :

Files.FileNameByName('exampletextfile.txt');

it gives the location of the copied project.

 

I need to put another location (the genuine one, before copy).

 

could I define somewhere in the copied project the location of the original Files folder ?

 

(because I use a lot batchs that are executed from plenty of locations)

 

Thank you,

 

Mehdi

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    What I would suggest is to remove the "Files" project item from your copied project and then right click on "Stores" and select "Add Existing Item". Then, when prompted, point to the existing files object in the drive folder for your original files. This assumes that the folder is network accessible from the location on which you are running the project.

    • m_essaid's avatar
      m_essaid
      Valued Contributor

      Hi Robert,

       

      I don't think this could be a clue,

      Firstable I don't have TC on the HyperV it's just TE instances,

      And even if, I cannot specify at each copies the Files...

       

      I wish I could do it by script.

    • m_essaid's avatar
      m_essaid
      Valued Contributor

      Hi,

       

      I finaly found a begining of solution for this issue :

      I made a function that, knowing the environment, (HyperV, others...) gives the string for the unc path.

      For example, when the /HV parameter don't exists it uses Files.FilenameByName

      At the opposite, it uses the unc path of the files before copy.