Forum Discussion

anandmar24's avatar
anandmar24
Occasional Contributor
11 years ago
Solved

To get the Temp folder path to save a file in it

Hi All,



I need one help. In my application under test, there is a button to export the grid values to excel. On clicking it, spreadsheet xml file is getting saved in the user profiles temp folder with specific name format (eg. xxstmp32f3.xml)). I need to compare the values from it with an expected result (in xml format). My problems are,



1. I cannot find the fully qualified path of the file since i dont know what will be the file name (in the example, only xxstmp is common, numbers behind that will vary).

2. Without getting the file path and name, how can I compare with my expected result?



Any ideas will be helpful.



Thanks In Advance.
  • You can get path to this folder with the help of environment variables.




    Log.Message(aqEnvironment.GetEnvironmentVariable('TEMP'));


    Log.Message(aqEnvironment.GetEnvironmentVariable('TMP'));

1 Reply

  • karkadil's avatar
    karkadil
    Valued Contributor
    You can get path to this folder with the help of environment variables.




    Log.Message(aqEnvironment.GetEnvironmentVariable('TEMP'));


    Log.Message(aqEnvironment.GetEnvironmentVariable('TMP'));