I am trying to execute below JSON code from Jmeter BeanShell Post processor but I am getting an error "Typed variable declaration : Class: JSONObject not found in namespace"
We are using JMeter 5.3 version and JSON jar files are available in the lib and lib\ext
import java.util.*;
import org.json.JSONObject;
import com.jayway.jsonpath.Criteria;
import com.jayway.jsonpath.Filter;
import com.jayway.jsonpath.JsonPath;
JSONObject cartItemsObj = (JSONObject) cartItems.get("C_cartItems");
log.info(cartItemsObj);
Error details:
2021-03-03 20:55:19,967 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import java.util.*; import com.jayway.jsonpath.Criteria; import com.jayway.json . . . '' : Typed variable declaration : Class: JSONObject not found in namespace
import java.util.*;
– user7294900