Bug 22820

Summary: max value on counter cannot be cleared
Product: JMeter - Now in Github Reporter: Brandon Ulrich <info>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P3    
Version: 1.9.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Brandon Ulrich 2003-08-29 18:01:32 UTC
The Counter pre-processor's maximum value cannot be cleared once set.  This 
tends to occur when initially limiting a counter's value to 1 during testing, 
then being unable to clear it later.  The other fields on the Counter form 
work as expected.

The workaround is to type a high value (9999) in the max field.

To reproduce:
1. Add Thread Group
2. Add Pre-Processer > Counter to Thread Group.
3. Set Maximum Value to 9
4. Click Thread Group to change focus.
5. Click  back to Counter, delete Maximum Value of 9.
6. Click Thread Group to change focus
7. Click back to Counter and note Maximum remains set to 9, instead of blank 
as expected.
Comment 1 prabhu 2004-02-06 11:50:06 UTC
Yes your right ,  I found the problem in CounterConfigGui.java, this problem 
would be solved by adding  following patch.

    /**
     * Modifies a given TestElement to mirror the data in the gui components.
     * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement
(TestElement)
     */
    public void modifyTestElement(TestElement c)
    {
        if (c instanceof CounterConfig)
        {
            CounterConfig config = (CounterConfig) c;
            config.setStart(startField.getText());
           /* if (endField.getText().length() > 0)
            {
                config.setEnd(endField.getText());
            }*/
            config.setEnd(endField.getText());
            config.setIncrement(incrField.getText());
            config.setVarName(varNameField.getText());
            config.setIsPerUser(perUserField.isSelected());
        }
        super.configureTestElement(c);
    }

Regards,
Prabhu
Comment 2 Sebb 2004-05-21 00:23:16 UTC
Fixed in branch 2.0
Comment 3 The ASF infrastructure team 2022-09-24 20:37:31 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1210