Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce property "resultcollector.action_if_file_exists" to control the popup "File already exists" when starting a test #4384

Closed
asfimport opened this issue May 4, 2017 · 10 comments

Comments

@asfimport
Copy link
Collaborator

orimarko (Bug 61068):
in jmeter 3.2 I started get a warning when running in GUI mode

for every file I write to there's a popup alert warning of file already exists

Please remove this warning or allow to choose remember my decision

OS: All

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
Can you explain a bit more, when the popup occurs?
I think this bug is connected to 58164. The implemented solution right now for that bug is to use command line parameter "-f" to delete all files that would get written.

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Hi Felix,
In gui mode, if you have many view results tree, when starting test, a popup will trigger for every occurence.

Regards

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
Ok, I see the dialog. I have attached a short test plan, that demonstrates the behaviour on the second run. It will display two dialogs - one after another - that ask how to continue with the result files.

Should we
a) add an option to pre-select a default behaviour?
b) add a gui option to remember the last selected behaviour for the next dialogs?
c) a) and b)?

Created attachment bug-61068.jmx: Dialog asking to overwrite results will be shown on each run

bug-61068.jmx
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.3-SNAPSHOT.20170520">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Testplan" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="Benutzer definierte Variablen" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread-Gruppe" enabled="true">
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Schleifen-Controller (Loop Controller)" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">1</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1495291835000</longProp>
        <longProp name="ThreadGroup.end_time">1495291835000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
          <boolProp name="ResultCollector.error_logging">false</boolProp>
          <objProp>
            <name>saveConfig</name>
            <value class="SampleSaveConfiguration">
              <time>true</time>
              <latency>true</latency>
              <timestamp>true</timestamp>
              <success>true</success>
              <label>true</label>
              <code>true</code>
              <message>true</message>
              <threadName>true</threadName>
              <dataType>true</dataType>
              <encoding>false</encoding>
              <assertions>true</assertions>
              <subresults>true</subresults>
              <responseData>false</responseData>
              <samplerData>false</samplerData>
              <xml>false</xml>
              <fieldNames>true</fieldNames>
              <responseHeaders>false</responseHeaders>
              <requestHeaders>false</requestHeaders>
              <responseDataOnError>false</responseDataOnError>
              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
              <assertionsResultsToSave>0</assertionsResultsToSave>
              <bytes>true</bytes>
              <sentBytes>true</sentBytes>
              <threadCounts>true</threadCounts>
              <idleTime>true</idleTime>
              <connectTime>true</connectTime>
            </value>
          </objProp>
          <stringProp name="filename">/tmp/results.txt</stringProp>
        </ResultCollector>
        <hashTree/>
        <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
          <boolProp name="ResultCollector.error_logging">false</boolProp>
          <objProp>
            <name>saveConfig</name>
            <value class="SampleSaveConfiguration">
              <time>true</time>
              <latency>true</latency>
              <timestamp>true</timestamp>
              <success>true</success>
              <label>true</label>
              <code>true</code>
              <message>true</message>
              <threadName>true</threadName>
              <dataType>true</dataType>
              <encoding>false</encoding>
              <assertions>true</assertions>
              <subresults>true</subresults>
              <responseData>false</responseData>
              <samplerData>false</samplerData>
              <xml>false</xml>
              <fieldNames>true</fieldNames>
              <responseHeaders>false</responseHeaders>
              <requestHeaders>false</requestHeaders>
              <responseDataOnError>false</responseDataOnError>
              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
              <assertionsResultsToSave>0</assertionsResultsToSave>
              <bytes>true</bytes>
              <sentBytes>true</sentBytes>
              <threadCounts>true</threadCounts>
              <idleTime>true</idleTime>
              <connectTime>true</connectTime>
            </value>
          </objProp>
          <stringProp name="filename">/tmp/results.txt</stringProp>
        </ResultCollector>
        <hashTree/>
        <JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="Java Anfrage (Request)" enabled="true">
          <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
            <collectionProp name="Arguments.arguments">
              <elementProp name="Sleep_Time" elementType="Argument">
                <stringProp name="Argument.name">Sleep_Time</stringProp>
                <stringProp name="Argument.value">100</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="Sleep_Mask" elementType="Argument">
                <stringProp name="Argument.name">Sleep_Mask</stringProp>
                <stringProp name="Argument.value">0xFF</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="Label" elementType="Argument">
                <stringProp name="Argument.name">Label</stringProp>
                <stringProp name="Argument.value"></stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="ResponseCode" elementType="Argument">
                <stringProp name="Argument.name">ResponseCode</stringProp>
                <stringProp name="Argument.value"></stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="ResponseMessage" elementType="Argument">
                <stringProp name="Argument.name">ResponseMessage</stringProp>
                <stringProp name="Argument.value"></stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="Status" elementType="Argument">
                <stringProp name="Argument.name">Status</stringProp>
                <stringProp name="Argument.value">OK</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="SamplerData" elementType="Argument">
                <stringProp name="Argument.name">SamplerData</stringProp>
                <stringProp name="Argument.value"></stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
              <elementProp name="ResultData" elementType="Argument">
                <stringProp name="Argument.name">ResultData</stringProp>
                <stringProp name="Argument.value">I am a Result</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
            </collectionProp>
          </elementProp>
          <stringProp name="classname">org.apache.jmeter.protocol.java.test.JavaTest</stringProp>
        </JavaSampler>
        <hashTree/>
      </hashTree>
    </hashTree>
    <WorkBench guiclass="WorkBenchGui" testclass="WorkBench" testname="WorkBench" enabled="true">
      <boolProp name="WorkBench.save">true</boolProp>
    </WorkBench>
    <hashTree/>
  </hashTree>
</jmeterTestPlan>

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Hi Felix,
I think it's what you have in mind, but I thought writing it might help us find issues:

1/ add an option : 'remember my choice for the next popups of this run':
=> User checks the option and clicks his choice
JMeter remembers this behaviour for next popups

2a/ on next run, if user has checked the option, it is still checked and the button that he selected previously is focused, so enter key starts the test applying his choice

2b/ on next run if he hasn't checked the option, same bahaviour as 1/

@asfimport
Copy link
Collaborator Author

mchassagneux (migrated from Bugzilla):
Hi Felix, Philippe

For me, add a properties in jmeter.properties to disable the warning popup is good enough because a check box to remember the decision has too much choice : for one run ? for on jmeter session ? all the time ? how rollback this choose ?
But it's as you wish, I can implement the fix as I push this commit first if you want too.

@asfimport
Copy link
Collaborator Author

orimarko (migrated from Bugzilla):
Behavior before 3.2 was to append to file by default

IMHO I think we should keep behavior as before,

Append to file by default and allow for each listener to override file

I think by adding another checkbox per listener - override file

If it's too much trouble I suggest a new property with override/append to prevent warning popup

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
(In reply to Philippe Mouawad from comment 4)

Hi Felix,
I think it's what you have in mind, but I thought writing it might help us
find issues:

1/ add an option : 'remember my choice for the next popups of this run':
=> User checks the option and clicks his choice
JMeter remembers this behaviour for next popups

Option 1 was - for me - add a property, that sets the default behaviour. That would be one of "append", "delete", "ask".

Option 2 was to ask the user the first time and give them an option to apply the currently used one for further decisions in that JMeter run.

2a/ on next run, if user has checked the option, it is still checked and the
button that he selected previously is focused, so enter key starts the test
applying his choice

2b/ on next run if he hasn't checked the option, same bahaviour as 1/

Option 3 was a combination, where we could remember the choice by setting the property chosen in 1.

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
(In reply to maxime.chassagneux from comment 5)

Hi Felix, Philippe

For me, add a properties in jmeter.properties to disable the warning popup
is good enough because a check box to remember the decision has too much
choice : for one run ? for on jmeter session ? all the time ? how rollback
this choose ?
But it's as you wish, I can implement the fix as I push this commit first if
you want too.

I think we should start by adding the property, that gets consulted before displaying the dialog to the user. If it is "ask", the dialog gets displayed, otherwise the action specified in the property will be chosen.

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Author: pmouawad
Date: Sun Jul 23 13:57:20 2017
New Revision: 1802724

URL: http://svn.apache.org/viewvc?rev=1802724&view=rev
Log:
#4384 - Introduce property "resultcollector.action_if_file_exists" to control the popup "File already exists" when starting a test
#4384

Modified:
jmeter/trunk/bin/jmeter.properties
jmeter/trunk/src/core/org/apache/jmeter/gui/action/AbstractAction.java
jmeter/trunk/xdocs/changes.xml
jmeter/trunk/xdocs/usermanual/properties_reference.xml

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Author: pmouawad
Date: Sun Jul 23 14:04:17 2017
New Revision: 1802727

URL: http://svn.apache.org/viewvc?rev=1802727&view=rev
Log:
#4384 - Introduce property "resultcollector.action_if_file_exists" to control the popup "File already exists" when starting a test
Mention property in popup
#4384

Modified:
jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant