csvSave (file name) - Selenium IDE command

The purpose of csvSave is to store (persist) the value of !csvLine to a CSV file. The file is stored in the browser local storage. You can view, export and delete it on the CSV management tab. If you call csvSave a second time (or in a second macro run) the data gets appended to the CSV file.

csvSave and !csvline explained

Note that when pushing data into !csvLine, you need to store every value separately. Because once csvSave is called, every value that is stored in the !csvLine internal array will get wrapped with “…” automatically (if needed) before saving (see the related forum post).

Important: csvSave and csvRead operate on different CSV files. You can use both in your macro at the same time, but any value added with !csvLine will only modify the file used for csvSave. The data loaded with csvRead is read-only and can only be accessed via the read-only ${!COLx} variables. But you can easily to "re-use" some of the loaded data for the output log file. Just add it to the output CSV file with store | ${COl1} | !csvLine. In this example, we add the value from the first column of the input CSV file to the output CSV file.

CSV Manager: Import (load) and export (save) CSV files from the Kantu extension

Use the CSV Manager tab to import (load) and export (save) CSV files to and from the Kantu extension. Inside a macro, you can export CSV files from the CSV tab (which stores the data in the Chrome/Firefox local storage) to your hard drive with the localStorageExport command.

NEW: If you have the Kantu FileAccess XModule installed, you can switch the macro storage mode to Hard-Drive Storage. This will also redirect all CSV read and write operation directly to the hard drive. By default, CSV files are then stored in the "kantu/datasources" folder.

csvSave Example

This short example below extracts two values from the website and stores them in a CSV file called "exchangerate.csv".

Command Target Pattern/Text
open https://ui.vision/
storeText id=USD !csvLine
storeText id=EURO !csvLine
csvSave exchangerate.csv

Works in

Kantu for Chrome Selenium IDE

Related Demo Macros


See also

csvRead, storeEval, Web Automation Extension User Manual, Selenium IDE commands, Classic Firefox Selenium IDE.

Anything wrong or missing on this page? Suggestions?

...then please contact us.

Kantu Selenium IDE for Chrome and Firefox - Web Test Automation
Subscribe to the a9t9 automation software newsletter . We'll send you updates on new releases that we're working on.