Output File Not Getting Saved when Staging on Linux

Document ID : KB000007043
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

This script will read an input file and build an XML string which then will be saved/transferred on to a remote location passed. The script accesses 2 jar files used for logging and file transfer. Those jar files already exist in both of our environments. The script works locally and/or staged locally. However when deployed to Linux servers, it seems to have worked, but the file does not get saved to the remote location.

Environment:
All Supported DevTest Environments and platforms
Cause:

1. You are writing out your output file to a Windows network drive which is fine from your local machine. 

2. Your Linux machine has no knowledge of the Windows drive since it is not mounted. 

 

Resolution:

You have decided to change your script when staging on Linux to write to a folder on your Linux machine and then copy the result file manually to the share drive where is needs to be finally output. 

 

In the future if you do not want to have to always change your script, you can do the following: 

1. Create a property in the local.properties file of your local machine, for example: FILE_LOCATION=//share/drive/folder/invoice/ 

2. Create a property in the local.properties file of your Simulator machine(s) (if you have more than one Simulator, will have to be on each machine), for example: FILE_LOCATION=<folder on Linux you can write to>/ 

3. Then in your script, refer to the {{FILE_LOCATION}} when building your XML file. 

4. This way the script would not need to be changed each time you target a different platform for your stage.

Additional Information:

Be aware of the following warning when writing to a delimited file. The Data directory can be used as the location of the CSV file only if both tests support rerun.

The first test must be run again to create the CSV in the lads folder so the second test can run. The lads directory stores files temporarily while a test case or suite is running.

To let the second test run without the first, you must put the data set in a common location outside the project or MAR.