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.

Column Name in CSV file while writing from XML Databank

Options
api_tester
api_tester Posts: 28
edited November 2019 in SOAtest

Hi Team,
I am trying to write the extracted element to a CSV file using python code.Is there any way I could achieve a scenario where the Column name is only written once.
eg:
I have extracted BillingAccountNumber using xml databank and I need to store in a CSV file.So I have given the Column name as BAN and written the value say 1234.But as I am using excel datasource having multiple rows I am getting the BAN column name again and again till the total iteration count that i have given in datasource.

Can anyone help me with this?

Thanks in adv.

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,232 ✭✭✭
    edited November 2019
    Options

    Your python script is what is writing to the CSV file, right? Maybe your script needs to be updated to keep track of whether it already wrote the column headers, so it doesn't keep writing them out redundantly.

    You may also consider why you are using the disk to pass data between test cases. SOAtest has a Data Bank tool and a Writable Data source as some of the ways for passing data. Using file system is also not necessarily thread safe, if you ever wish to leverage your tst in a load/performance test later.

  • api_tester
    api_tester Posts: 28
    Options

    Thanks @benken_parasoft . I need for log purpose so I have saved it in file.