Bug 63974 - resultcollector.action_if_file_exists=DELETE don't work
Summary: resultcollector.action_if_file_exists=DELETE don't work
Status: NEW
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.4.1
Hardware: PC All
: P2 regression (vote)
Target Milestone: JMETER_5.4
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-28 10:06 UTC by vrithner
Modified: 2021-07-30 17:15 UTC (History)
3 users (show)



Attachments
Sample Data Writer Csv file path (46.32 KB, image/png)
2019-11-28 10:06 UTC, vrithner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vrithner 2019-11-28 10:06:12 UTC
Created attachment 36903 [details]
Sample Data Writer Csv file path

Hello,
I'm documenting how to test web applications on one of my customer's PC.

Each time I start a test, I need to delete manually the csv result file and I'm not even prompted the file exist. 
It's annoying so I found a post to delete it automatically.

-I have uncommented the line in jmeter.properties
resultcollector.action_if_file_exists and set it like that:
resultcollector.action_if_file_exists=DELETE*

-I restarted JMeter and started a new test but the result file wasn't deleted; data are added to the previous one.

Any idea what this is happening ?
Thanks in advance for any help
Comment 1 Felix Schumacher 2019-11-28 11:28:32 UTC
Are there any log messages in the log files?

I assume the star (*) at the end of DELETE is a left over from an attempt to highlight the value.

Have you checked that you are editing the correct properties file?
Comment 2 vrithner 2019-11-28 12:08:04 UTC
Hi,
Yes, the star is just an typo mistake
Yes, the properties file is the correct one

Now, since i reported the "bug", I found if I change template for a Web Test Plan, it's working.

For my case, I was in a Recording Template and in this case, it's not working.

Hope it's help...

Txs
Cheers
Comment 3 Philippe Mouawad 2019-12-27 21:47:59 UTC
(In reply to vrithner from comment #2)
> Hi,
> Yes, the star is just an typo mistake
> Yes, the properties file is the correct one
> 
> Now, since i reported the "bug", I found if I change template for a Web Test
> Plan, it's working.
> 
> For my case, I was in a Recording Template and in this case, it's not
> working.
> 
> Hope it's help...
> 
> Txs
> Cheers

Hello,
In the end, I don't understand the bug report.
Can you please clarify how to reproduce issue ?

I tried using Recording Template, setting this property, I see no issue.

Thank you
Comment 4 miki 2021-02-16 13:46:03 UTC
Hello, 

I've the same issue right now on jmeter 5.4.1

Looks like the problem apears when there's variable reference in file name
e.g.:
1.my jmeter.properties entry : 
resultcollector.action_if_file_exists=ASK
2.my Filename entry in 'View Result Tree":
C:\jmeter\apache-jmeter-5.4.1\bin\_REPORTS\CSV\S1_Results_${ResultFileId}.csv

3.I start the test
4.I start the test again = jmeter NOT asking for action on file exist but append to existig file

5. Change Filename entry in 'View Result Tree":
C:\jmeter\apache-jmeter-5.4.1\bin\_REPORTS\CSV\S1_Results_GUI.csv

6.I start the test
7.I start the test again = jmeter ASKING for action on file exist
Comment 5 Rajesh Bajjuri 2021-07-30 17:12:55 UTC
Hello, 


I have the similar issue here 

in "View Results in Table" listener if i am using Variable in the "Write Results to File name" Field like ${JmeterUserDirectory}\TestResults\ShuttleViewTestResults.csv which is relative path and using user defined variables for path name.

Then it is not Deleting the existing results file even after the below property is set in Jmeter.properties or user.properties file

resultcollector.action_if_file_exists=DELETE


However in "View Results in Table" if i change "Write Results to File name" Field like below which is direct path and not using any user defined variables.

C:\Softwares\apache-jmeter-5.1.1\bin\TestResults\ShuttleViewTestResults.csv

Then it is asking a pop up saying if i need to append or override the results etc...

so below property is never given an importance as it is still asking for popup even after it is set to value as DELETE.
resultcollector.action_if_file_exists=DELETE
Comment 6 The ASF infrastructure team 2022-09-24 20:38:18 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5205