Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

CSV file newly generated in a local folder , how can we use the latest sheet in subsequent step ?

Options
Pattu
Pattu Posts: 11

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.

Tagged:

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,230 ✭✭✭
    Options

    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.

  • Pattu
    Pattu Posts: 11
    Options
    1. I am running a autosys job and it will generate 4 CSV files in a local folder
    2. I have to find the latest sheet from that and use that sheet as a data source in my next test step
    3. I am looking how to do this ?
  • Pattu
    Pattu Posts: 11
    Options

    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

  • Pattu
    Pattu Posts: 11
    Options

    Should it be covered as a custom script using extension tool or is it something doable without a script?

  • Pattu
    Pattu Posts: 11
    Options

    @benken_parasoft can you please help ?

  • Matt Love
    Matt Love Posts: 92 admin
    Options

    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.

  • Pattu
    Pattu Posts: 11
    Options

    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 ?

  • Matt Love
    Matt Love Posts: 92 admin
    Options

    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.