tuanhiep / mqttjmeter

This is the plugin for Jmeter to Test MQTT protocol
Apache License 2.0
86 stars 56 forks source link

MQTT Publisher & Subscriber - Fields not retaining value #6

Open bhar008 opened 10 years ago

bhar008 commented 10 years ago

Hi,

In MQTT Publisher, the "Client ID" field is not able to retain or save any values. I enter a value in the Client ID field and if i click on any other component in the test plan and come back to the MQTT sampler, the value in the field disappears. Similarly, the "Random Suffix" check box is checked whenever the script is opened, whereas i want the checkbox to be unchecked always.

In the MQTT Subscriber, the Cient ID field is able to retain the value but the Random Suffix is checked everytime i open the script although i made sure it is unchecked and the script is saved.

Please tell me why this issue occurs and also it would be great if you could tell me the purpose of the Random suffix checkbox.

Thanks, BK

firesh-bakhda commented 9 years ago

In MQTT Publisher, the "Client ID" field is not able to retain or save any values. I enter a value in the Client ID field and if i click on any other component in the test plan and come back to the MQTT sampler, the value in the field disappears. Similarly, the "Random Suffix" check box is checked whenever the script is opened, whereas i want the checkbox to be unchecked always.

I am having the same issue too

firesh-bakhda commented 9 years ago

@tuanhiep - Please do have a look at this issue. I have just downloaded the latest master branch code and the issue still persist.

okryvorotko commented 8 years ago

I have the same issue too.

vraghavachari commented 8 years ago

I believe this is a bug in the code. Here is how I was able to fix it.

  1. Modify the MQTTPublisherGui.java file as below.
  2. Build and generate a new mqtt-jmeter.jar and place them in your JMETER/lib/ext folder.
  3. Reopen JMeter tool.
public void configure(TestElement el) {
....
mqttUser.setEnabled(useAuth.isSelected());
mqttPwd.setEnabled(useAuth.isSelected());

    //Adding the missing "Set" for the following UI elements.
    clientId.setText(sampler.getCLIENT_ID());
    suffixClientId.setSelected(sampler.useRandomSuffix());
    this.connectionPerTopic.setSelected(sampler.isOneConnectionPerTopic());

......

}