23
votes

When I try to enter anything in the body of HTTP Request, when I click anything else, I get:

You cannot switch because data cannot be converted to Target tab data, empty data to switch

What is that ? I am running Windows 10.

1
Do you have any parameters in your request?Iske
Nope, I do not. I want to add Json body to post request. That is all.Jerzy Gruszka
Are you trying to go back to "Parameters" tab after you have entered some data to "Body Data" tab?Iske
Yes, I am. But I cannot go to any tabJerzy Gruszka
Have a look at this. Especially at section Parameter Handling.Iske

1 Answers

13
votes

Stumbled across this very issue recently, which confused me. JMeter’s documentation on Parameter Handling says this is normal. To switch back to another tab you have to clear the data.

Note that once you leave the Tree node, you cannot switch back to the parameter tab unless you clear the Body Data tab from its data.

It is possible to switch from the Parameters tab to the Body Data tab and JMeter will automatically convert data for you, but not vice-versa, since the Body Data tab allows you to enter more complex data, such as JSON, XML, & SOAP for your HTTP requests. This indicator doesn’t prevent you from using the request for testing, it only blocks you from switching over to the other tabs.