October 20, 2011

Creating a CSV File in QA Wizard Pro

Helix ALM
During testing, many applications create data, such as order numbers and totals, that may be needed later. Instead of only printing the data or verifying the format is correct, you can write the data to a CSV file so you'll be able to access it again. In this example, we'll use the “Web 02 Call” script in the QA Wizard Pro Sample Workspace to  call the “xx Print Ticket Number” script (see Figure 1). The "xx Print Ticket Number" script prints the generated ticket number to the output window. In addition to printing the ticket number, we'll also use the AppendToFile statement to save it to a file so the data can be used by another script. [caption id="attachment_10117" align="aligncenter" width="500" caption="Figure 1: xx Print Ticket Number script"][/caption]

When a ticket number is found, the AppendToFile statement saves it to a text file. In the example in Figure 2, the AppendToFile statement writes the ticket number to a new line in the file. The %SCRIPTS% environment variable in the output file path references the current script directory.

[caption id="attachment_10116" align="aligncenter" width="500" caption="Figure 2: Save the ticket number to a new line"][/caption]

If you want, you can save additional information. In Figure 3, the AppendToFile statement writes the ticket number plus the current date/time, separated by a comma, on a new line.

[caption id="attachment_10119" align="aligncenter" width="500" caption="Figure 3: Save the ticket number plus the current date/time, separated by a comma"][/caption] After the CSV file is created, it can be accessed as an external datasheet by any other script. For more QA Wizard Pro tips, be sure to check out the QA Wizard Pro Resource Center.