Thursday, November 18, 2010

VSTS data bindings and unicode

I have a test with a data source (settings.csv) and a data binding (mysetting). Settings.csv exists, and there's an entry for 'mysetting', but VSTS complains:
Error...Could not run Web test 'test' on agent 'agent': Could not access table 'settings#csv' in data source 'settingsSource' of test '12345678-abcd-abcd-abcd-12345678abcd': No value given for one or more required parameters.

Turns out it's because the csv file is Unicode. The easiest way to fix this (for me, at any rate), is Powershell:
cat settings.csv | out-file temp.csv -encoding ascii
Compare the sizes of settings.csv and temp.csv with ls. If temp.csv is smaller, then settings.csv was unicode.
mv temp.csv settings.csv -force

The truly maddening thing is that VS seems to be saving out as Unicode itself, so I have to edit my csv files elsewhere.

No comments: