Forum Discussion
joseph_michaud
Staff
12 years agoI tried to use aqFile WriteToTextFile for myself for the first time. I noticed some traps for the unwary (all of which I fell into):
- Your Path parameter doesn't look right. I suspect that you used a Code Expression and entered a string. Rather, enter a Constant of String Type with the filename as the Value. When done, that Step in your Test Steps window should show the backslashes doubled.
- I forgot to modify the TextCodingType parameter. The default of '0' doesn't work (for me). For that I had to use a Code Expression with a Value of aqFile.ctANSI (or a Constant Integer of 20). Other values are available. See the article
WriteToTextFile Method
- You may need to set the OverwriteOrCreate parameter to true.
- Your Path parameter doesn't look right. I suspect that you used a Code Expression and entered a string. Rather, enter a Constant of String Type with the filename as the Value. When done, that Step in your Test Steps window should show the backslashes doubled.
- I forgot to modify the TextCodingType parameter. The default of '0' doesn't work (for me). For that I had to use a Code Expression with a Value of aqFile.ctANSI (or a Constant Integer of 20). Other values are available. See the article
WriteToTextFile Method
- You may need to set the OverwriteOrCreate parameter to true.