Column Name in CSV file while writing from XML Databank

api_testerapi_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.
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.


  • benken_parasoftbenken_parasoft Posts: 1,001 ✭✭✭
    edited November 2019

    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_testerapi_tester Posts: 28

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

Sign In or Register to comment.