CSV file newly generated in a local folder , how can we use the latest sheet in subsequent step ?
Once a job is completed. A csv file will be loaded in a local folder like example : c drive.
Latest transaction file should be picked up for the testing is the scenario under concern now.
we should be able to pick the latest file on that particular day and time and use this data source in subsequent step.
Answers
-
Can you explain what you mean by "job"? Are you using a SOAtest test case to somehow trigger this job? Is this CSV file something produced by the application under test that you need to validate? Or is this job just something that provides your test data?
How do you intend to use this CSV file for testing? If you just need to check its contents then you would use Diff tool, for example. Otherwise, if this this job something that provides your test data then a CSV Data Source could be used, assuming you expect your test scenario to iterate over this data row-by-row. The CSV file is loaded before running the first test in the tst file. So, you just need to make sure that the CSV on on disk first before running the tst that requires the data. Perhaps this means you have two tst files, one to get the CSV and a second to use it, for example.
0 -
- I am running a autosys job and it will generate 4 CSV files in a local folder
- I have to find the latest sheet from that and use that sheet as a data source in my next test step
- I am looking how to do this ?
0 -
Data sheet is saved in a name like "transactionfile.csv" and instead of manually selecting the path every day I need something to make this run on its own like , every day after autosys job has run, the sheet path which we mention in the file path in step 2 should automatically pick up the latest CSV file generated on that folder
0 -
Should it be covered as a custom script using extension tool or is it something doable without a script?
0 -
@benken_parasoft can you please help ?
0 -
Hi @Pattu
SOAtest CVS data sources must reference an exact file name. If the name or path to your transactionfile.csv is dynamic, then I recommend renaming it to a consistent path and file name as part of the job that generates it, such as "latest/transactionfile.csv" and configure your CVS Data Source in SOAtest to always use that.0 -
hi @Matt Love
Thanks for responding. I was looking for something which can be handled via script so every time I don't have to change the sheet name , if its doable by using a groovy or Java script to set up the path and pick up the latest file based on time stamp and date, that would be a permanent reliable solution .
any pointers like above ? is that a good approach ?0 -
Many fields in SOAtest support scripted values, but the path to a CSV Data Source file is not one of them. The file will need to be renamed outside of SOAtest first before it can be used in a CSV Data Source.
0