How to compare database query results with a string using Bean Shell Assertion in JMeter - jmeter-5.0

I am new to JMeter.
In my Test Plan I am using
JDBC Connection Configuration to connect SQL database.
JDBC Request to run the select query. And I used Variable Names field to store the FK_SiteId from the database response as shows below.
I used Debug Sampler to print the FK_SiteId in the results. Please find the Debug result.
I am using BeanShell Assertion to compare the Actual FK_SiteId with Expected FK_SiteId as shown below.
Please find the error message below.
2019-03-04 12:25:45,549 INFO o.a.j.e.StandardJMeterEngine: Running the test! 2019-03-04 12:25:45,549 INFO o.a.j.s.SampleEvent: List of sample_variables: [] 2019-03-04 12:25:45,549 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2019-03-04 12:25:45,661 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : SQL Database Connection 2019-03-04 12:25:45,661 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group SQL Database Connection.
2019-03-04 12:25:45,661 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2019-03-04 12:25:45,661 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2019-03-04 12:25:45,677 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2019-03-04 12:25:45,677 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2019-03-04 12:25:45,677 INFO o.a.j.t.JMeterThread: Thread started: SQL Database Connection 1-1
2019-03-04 12:25:50,564 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String ActialResult = vars.get(${FK_SiteId}); String ExpectedResult = "14001"; . . . '' : Typed variable declaration : Attempt to access property on undefined variable or class name
2019-03-04 12:25:50,564 WARN o.a.j.a.BeanShellAssertion: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String ActialResult = vars.get(${FK_SiteId}); String ExpectedResult = "14001"; . . . '' : Typed variable declaration : Attempt to access property on undefined variable or class name
2019-03-04 12:25:50,564 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String ActialResult = vars.get(${FK_SiteId}); String ExpectedResult = "14001"; . . . '' : Typed variable declaration : Attempt to access property on undefined variable or class name
2019-03-04 12:25:50,564 WARN o.a.j.a.BeanShellAssertion: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String ActialResult = vars.get(${FK_SiteId}); String ExpectedResult
= "14001"; . . . '' : Typed variable declaration : Attempt to access property on undefined variable or class name
2019-03-04 12:25:50,564 INFO o.a.j.t.JMeterThread: Thread is done: SQL Database Connection 1-1
2019-03-04 12:25:50,564 INFO o.a.j.t.JMeterThread: Thread finished: SQL Database Connection 1-1
2019-03-04 12:25:50,564 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-03-04 12:25:50,564 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
Can anyone tell me where I am going wrong

Your variable was saved as FK_SiteId_1. You can access this variable by
vars.get("FK_SiteId_1") or directly ${FK_SiteId_1}
Use log.info(... to check the variable value
I prefer to use vars.get solution.

Related

Fail test on variables comparison (JSR223 PostProcessor) / Error in data types

How can I compare the value of "plus" in the condition "else if(plus == 4){"
The action takes place in "Logic Controller" → "While Controller"
Initially, the value "plus" is taken from "User Defined Variables". The Jmeter variable "${plus}" will be overwritten until the value of "plus" is = 4
def number = 0;
def plus = vars.get("plus").toInteger();
if (vars.get("payment_verification").equals("NOTPAID")){
else if(plus == 4){
log.error("plus = 4");
} else {
number = 100;
plus++;
vars.put("number", number.toString());
vars.put("plus", plus.toString());
log.info(number);
log.info(plus);
}
} else if (vars.get("payment_verification").equals("COMPLETED")){
number = 50;
vars.put("number", number.toString());
} else if (vars.get("payment_verification").equals("NOT_FOUND"){
log.error("Параметр payment_verification не найден!");
prev.setSuccessful(false);
}
Error at the moment:
2021-10-19 17:46:32,261 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2021-10-19 17:46:32,261 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2021-10-19 17:46:32,274 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2021-10-19 17:46:32,341 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2021-10-19 17:46:32,342 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2021-10-19 17:46:32,342 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2021-10-19 17:46:32,342 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2021-10-19 17:46:32,344 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2021-10-19 17:46:32,344 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2021-10-19 17:46:32,346 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2021-10-19 17:47:04,841 ERROR o.a.j.e.JSR223PostProcessor: Problem in JSR223 script, JSR223 PostProcessor
javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script2719.groovy: 6: Unexpected input: '{\n\t\n\telse' # line 6, column 2.
else if(plus == 4){
^
1 error
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.compile(GroovyScriptEngineImpl.java:183) ~[groovy-jsr223-3.0.7.jar:3.0.7]
at org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:211) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.extractor.JSR223PostProcessor.process(JSR223PostProcessor.java:45) [ApacheJMeter_components.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.java:955) [ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:573) [ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.1]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script2719.groovy: 6: Unexpected input: '{\n\t\n\telse' # line 6, column 2.
else if(plus == 4){
^
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:295) ~[groovy-3.0.7.jar:3.0.7]
at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:151) ~[groovy-3.0.7.jar:3.0.7]
at org.apache.groovy.parser.antlr4.AstBuilder.collectSyntaxError(AstBuilder.java:4582) ~[groovy-3.0.7.jar:3.0.7]
at org.apache.groovy.parser.antlr4.AstBuilder.access$000(AstBuilder.java:341) ~[groovy-3.0.7.jar:3.0.7]
at org.apache.groovy.parser.antlr4.AstBuilder$1.syntaxError(AstBuilder.java:4597) ~[groovy-3.0.7.jar:3.0.7]
at groovyjarjarantlr4.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:44) ~[groovy-3.0.7.jar:3.0.7]
at groovyjarjarantlr4.v4.runtime.Parser.notifyErrorListeners(Parser.java:543) ~[groovy-3.0.7.jar:3.0.7]
You don't need this else keyword in if (plus == 4) { line
There is missing closing parentheses in } else if (vars.get("payment_verification").equals("NOT_FOUND"){ line
Lines like log.info(number); will fail as well because you can print only Strings, they need to be changed to something like log.info(number as String)
Suggested code fix:
def number = 0;
def plus = vars.get("plus").toInteger();
if (vars.get("payment_verification").equals("NOTPAID")) {
if (plus == 4) {
log.error("plus = 4");
} else {
number = 100;
plus++;
vars.put("number", number.toString());
vars.put("plus", plus.toString());
log.info(number as String);
log.info(plus as String);
}
} else if (vars.get("payment_verification").equals("COMPLETED")) {
number = 50;
vars.put("number", number.toString());
} else if (vars.get("payment_verification").equals("NOT_FOUND")) {
log.error("Параметр payment_verification не найден!");
prev.setSuccessful(false);
}
You can use an IDE like Intellij IDEA for developing/testing your Groovy scripts.
Also there are vars.getObject() and vars.putObject() functions, this way you can avoid conversion of strings to integers and vice versa. See Top 8 JMeter Java Classes You Should Be Using with Groovy article for more details on this and other JMeter API shorthands.

apache nifi Stateless - not able to set parm of controller service (DBCPConnectionPool 1.10.0)

I am following the NiFi 1.10 stateless guildeline to create a simple process group of executing a sql in mysql db. I have put necessary parm of db controller service to parameter context.
it works well in nifi canvas. Then i add it to registry and prepare a json parm file: stateless-simpledb.json
{
"registryUrl": "http://localhost:18080",
"bucketId": "cac8f127-e328-45c1-a4cb-0e03dc837ceb",
"flowId": "cc2753f2-78f3-4449-a2fd-343dfeaafe15",
"flowVersion": "3",
"parameters": {
"lastIngestId" : "20000",
"mysql-jdbc-driver-name" : "com.mysql.jdbc.Driver",
"db-user" : "root",
"db-password" : "password",
"db-con-url" : "jdbc:mysql://localhost:3306/mms",
"jdbc-jar-path" : "/program/jdbc/mysql-connector-java.jar"
}
}
and run the one-off command:
/program/nifi/bin/nifi.sh stateless RunFromRegistry Once --file /app/poc/nifi-stateless/conf/stateless-simpledb.json
It raise error:
=== FlowFileRepository Type ===
org.apache.nifi.controller.repository.RocksDBFlowFileRepository
org.apache.nifi:nifi-framework-nar:1.10.0 || /program/nifi-1.10.0/work/stateless-nars/nifi-framework-nar-1.10.0.nar-unpacked
org.apache.nifi.controller.repository.WriteAheadFlowFileRepository
org.apache.nifi:nifi-framework-nar:1.10.0 || /program/nifi-1.10.0/work/stateless-nars/nifi-framework-nar-1.10.0.nar-unpacked
org.apache.nifi.controller.repository.VolatileFlowFileRepository
org.apache.nifi:nifi-framework-nar:1.10.0 || /program/nifi-1.10.0/work/stateless-nars/nifi-framework-nar-1.10.0.nar-unpacked
=== End FlowFileRepository types ===
23:32:32.626 [main] INFO org.apache.nifi.stateless.bootstrap.ExtensionDiscovery - Successfully discovered extensions in 4411 milliseconds
23:32:32.633 [main] DEBUG org.apache.nifi.stateless.core.ComponentFactory - Setting context class loader to org.apache.nifi.nar.InstanceClassLoader#50fa5938 (parent = org.apache.nifi.nar.NarClassLoader[/program/nifi-1.10.0/work/stateless-nars/nifi-dbcp-service-nar-1.10.0.nar-unpacked]) to create org.apache.nifi.dbcp.DBCPConnectionPool
23:32:32.647 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input #{jdbc-jar-path} found 1 Parameter references: [org.apache.nifi.parameter.StandardParameterReference#2d3eecda]
23:32:32.650 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input /program/jdbc/mysql-connector-java.jar found 0 Parameter references: []
23:32:32.651 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input 500 millis found 0 Parameter references: []
23:32:32.651 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input 8 found 0 Parameter references: []
23:32:32.651 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input 0 found 0 Parameter references: []
23:32:32.651 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input 8 found 0 Parameter references: []
23:32:32.651 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input -1 found 0 Parameter references: []
23:32:32.651 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input -1 found 0 Parameter references: []
23:32:32.651 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input 30 mins found 0 Parameter references: []
23:32:32.651 [main] DEBUG org.apache.nifi.parameter.ExpressionLanguageAwareParameterParser - For input -1 found 0 Parameter references: []
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.nifi.bootstrap.RunStatelessNiFi.main(RunStatelessNiFi.java:69)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.nifi.StatelessNiFi.main(StatelessNiFi.java:103)
... 5 more
Caused by: java.lang.RuntimeException: Failed to enable Controller Service {id=691ecc97-ff46-3a5e-8aad-37dc568bc247, name=MYSQL-MMS-stateless-test, type=class org.apache.nifi.dbcp.DBCPConnectionPool} because validation failed: ['Database Connection URL' is invalid because Database Connection URL is required, 'Database Driver Class Name' is invalid because Database Driver Class Name is required]
at org.apache.nifi.stateless.core.StatelessControllerServiceLookup.enableControllerServices(StatelessControllerServiceLookup.java:133)
at org.apache.nifi.stateless.core.StatelessFlow.<init>(StatelessFlow.java:153)
at org.apache.nifi.stateless.core.StatelessFlow.createAndEnqueueFromJSON(StatelessFlow.java:469)
at org.apache.nifi.stateless.runtimes.Program.runLocal(Program.java:133)
at org.apache.nifi.stateless.runtimes.Program.launch(Program.java:67)
... 10 more
Seems the apache nifi stateless function failed to set controller service even it's in "process group" scope.
Would anyone has any advice?
As mentioned in the comments, this appears to be a known problem with the validation of controller services.
This can be avoided by using Nifi 1.12 and above as it got fixed in the following jira: https://issues.apache.org/jira/plugins/servlet/mobile#issue/NIFI-7380
Though I am not entirely sure of this, it may also be possible that this simply indicates that your controller service is not configured correctly. This would be worth double checking.

JMeter Non Gui Mode - Unable to run. Please advise

I have a threadgroup with no of threads = 30 and ramp up = 1. I have a single transaction controller inside this thread group. Inside Transaction controller, there is a synchronizing timer set to 5 users per group and also multiple module controllers pointing to different test fragments residing under same test plan. Each of these test fragments contain a transaction controller and a uniform random timer set to 1000ms.
I am trying to execute the script in non gui mode as follows
jmeter -n -t [path of script] -l [path of output file]
Test gets stopped and I see following messages in log file. Not sure why log shows 0 threads when I actually set the thread count to 30.
2017/03/08 17:00:32 INFO - jmeter.JMeter: Creating summariser <summary>
2017/03/08 17:00:32 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2017/03/08 17:00:32 INFO - jmeter.samplers.SampleEvent: List of sample_variables: [ID]
2017/03/08 17:00:32 INFO - jmeter.samplers.SampleEvent: List of sample_variables: [ID]
2017/03/08 17:00:32 INFO - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.'
2017/03/08 17:00:32 INFO - jmeter.engine.util.CompoundVariable: Note: Function class names must not contain the string: '.gui.'
2017/03/08 17:00:33 INFO - jmeter.JMeter: Running test (1489014033090)
2017/03/08 17:00:33 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2017/03/08 17:00:33 INFO - jmeter.engine.StandardJMeterEngine: Starting 0 threads for group Thread Group.
2017/03/08 17:00:33 INFO - jmeter.engine.StandardJMeterEngine: Thread will continue on error
2017/03/08 17:00:33 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 0 ramp-up 1 perThread Infinity delayedStart=false
2017/03/08 17:00:33 INFO - jmeter.threads.ThreadGroup: Started thread group number 1
2017/03/08 17:00:33 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2017/03/08 17:00:33 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2017/03/08 17:00:33 INFO - jmeter.reporters.Summariser: summary = 0 in 00:00:00 = ******/s Avg: 0 Min: 9223372036854775807 Max: -9223372036854775808 Err: 0 (0.00%)
Please guide me where I am getting wrong. Thanks.
An extra space is present before number of threads. in ThreadGroup. After I delete the space, Its working.

Jmeter Magento Error

I'm trying to run JMeter for performance testing on a Magento 2 website. So, far I've been able to integrate the benchmark.jmx file provided by Magento into JMeter. But when I try to run it, it starts and ends immediately. This is the error I get
2016/09/01 09:43:43 WARN - jmeter.testbeans.BeanInfoSupport: Localized strings not available for bean class kg.apc.jmeter.config.redis.RedisDataSet java.util.MissingResourceException: Can't find bundle for base name kg.apc.jmeter.config.redis.RedisDataSetResources, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:795)
at org.apache.jmeter.testbeans.BeanInfoSupport.<init>(BeanInfoSupport.java:126)
at kg.apc.jmeter.config.redis.RedisDataSetBeanInfo.<init>(RedisDataSetBeanInfo.java:69)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:383)
at com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:96)
at com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:66)
at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:438)
at java.beans.Introspector.<init>(Introspector.java:388)
at java.beans.Introspector.getBeanInfo(Introspector.java:163)
at org.apache.jmeter.testbeans.gui.TestBeanGUI.<init>(TestBeanGUI.java:168)
at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:488)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:160)
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:77)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
2016/09/01 09:43:44 INFO - jmeter.util.BSFTestElement: Registering JMeter version of JavaScript engine as work-round for BSF-22
2016/09/01 09:43:45 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/09/01 09:43:45 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/09/01 09:43:45 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/09/01 09:43:45 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2016/09/01 09:43:45 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2016/09/01 09:43:45 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser
2016/09/01 09:43:45 INFO - jorphan.exec.KeyToolUtils: keytool found at 'keytool'
2016/09/01 09:43:45 INFO - jmeter.protocol.http.proxy.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file /home/yassar/Downloads/jmeter/apache-jmeter-3.0/bin/proxyserver.jks
2016/09/01 09:43:45 INFO - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.config.MongoSourceElement
2016/09/01 09:43:45 INFO - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_qos]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_at_most_once]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_at_least_once]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_exactly_once]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_client_types]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_blocking_client]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_async_client]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_message_input_type]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_message_input_type_text]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_message_input_type_file]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_qos]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_at_most_once]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_at_least_once]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_exactly_once]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_client_types]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_blocking_client]
2016/09/01 09:43:45 WARN - jmeter.util.JMeterUtils: ERROR! Resource string not found: [mqtt_async_client]
2016/09/01 09:43:46 INFO - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.visualizers.DistributionGraphVisualizer
2016/09/01 09:43:46 INFO - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times
2016/09/01 09:43:46 INFO - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2016/09/01 09:43:46 INFO - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true
2016/09/01 09:43:46 INFO - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000
2016/09/01 09:43:46 INFO - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.visualizers.SplineVisualizer
2016/09/01 10:25:41 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2016/09/01 10:25:41 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2016/09/01 10:25:41 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2016/09/01 10:25:41 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*)
2016/09/01 10:25:42 INFO - jmeter.engine.StandardJMeterEngine: No enabled thread groups found
2016/09/01 10:25:42 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2016/09/01 10:25:42 INFO - jmeter.services.FileServer: Default base='/home/yassar/Downloads/jmeter/apache-jmeter-3.0/bin'
2016/09/01 10:25:42 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*)
2016/09/01 10:25:50 INFO - jmeter.gui.action.Load: Loading file: /home/yassar/Downloads/benchmark.jmx
2016/09/01 10:25:50 INFO - jmeter.services.FileServer: Set new base='/home/yassar/Downloads'
2016/09/01 10:25:50 INFO - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2016/09/01 10:25:50 INFO - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8
2016/09/01 10:25:50 INFO - jmeter.save.SaveService: Using SaveService properties version 2.9
2016/09/01 10:25:50 INFO - jmeter.save.SaveService: All converter versions present and correct
2016/09/01 10:25:50 INFO - jmeter.save.SaveService: Loading file: /home/yassar/Downloads/benchmark.jmx
2016/09/01 10:25:50 WARN - jmeter.gui.action.Load: Unexpected error java.lang.IllegalArgumentException: Problem loading XML from:'/home/yassar/Downloads/benchmark.jmx', cannot determine class for element: com.thoughtworks.xstream.mapper.CannotResolveClassException: is-copy-enabled is-u2f-enabled
at org.apache.jmeter.save.SaveService.readTree(SaveService.java:533)
at org.apache.jmeter.save.SaveService.loadTree(SaveService.java:503)
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:130)
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:102)
at org.apache.jmeter.gui.action.Load.doAction(Load.java:89)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80)
at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:62)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:77)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: is-copy-enabled is-u2f-enabled
at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at org.apache.jmeter.save.SaveService$XStreamWrapper$1.realClass(SaveService.java:98)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:31)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:133)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1206)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1190)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1061)
at org.apache.jmeter.save.SaveService.readTree(SaveService.java:524)
... 21 more
2016/09/01 10:26:12 INFO - jmeter.gui.action.Load: Loading file: /home/yassar/Projects/m205/setup/performance-toolkit/benchmark.jmx
2016/09/01 10:26:12 INFO - jmeter.services.FileServer: Set new base='/home/yassar/Projects/m205/setup/performance-toolkit'
2016/09/01 10:26:12 INFO - jmeter.save.SaveService: Loading file: /home/yassar/Projects/m205/setup/performance-toolkit/benchmark.jmx
2016/09/01 10:26:12 INFO - jmeter.protocol.http.control.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_
2016/09/01 10:26:13 INFO - jmeter.services.FileServer: Set new base='/home/yassar/Projects/m205/setup/performance-toolkit'
2016/09/01 10:27:08 INFO - jmeter.services.FileServer: Set new base='/home/yassar/Projects/m205/setup/performance-toolkit'
2016/09/01 10:27:11 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2016/09/01 10:27:11 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2016/09/01 10:27:11 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*)
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: Starting setUp thread groups
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: Starting setUp ThreadGroup: 1 : setUp Thread Group
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group setUp Thread Group.
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: Test will stop on error
2016/09/01 10:27:12 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false
2016/09/01 10:27:12 INFO - jmeter.threads.ThreadGroup: Started thread group number 1
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: Waiting for all setup thread groups to exit
2016/09/01 10:27:12 INFO - jmeter.threads.JMeterThread: Thread started: setUp Thread Group 1-1
2016/09/01 10:27:12 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``Boolean stopTestOnError (String error) { log.error(error); System.out.pr . . . '' : Method Invocation path.substring
2016/09/01 10:27:12 WARN - jmeter.protocol.java.sampler.BeanShellSampler: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``Boolean stopTestOnError (String error) { log.error(error); System.out.pr . . . '' : Method Invocation path.substring
2016/09/01 10:27:12 INFO - jmeter.threads.JMeterThread: Stop Test detected by thread: setUp Thread Group 1-1
2016/09/01 10:27:12 INFO - jmeter.threads.JMeterThread: Thread finished: setUp Thread Group 1-1
2016/09/01 10:27:12 INFO - jmeter.threads.JMeterThread: Stopping: setUp Thread Group 1-1
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: All Setup Threads have ended
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: No enabled thread groups found
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: Starting tearDown thread groups
2016/09/01 10:27:12 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2016/09/01 10:27:12 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*)
It seems you are missing some plug-ins that are used along with this JMX. You need to copy these plug-ins in under JMeter /lib/ext folder and it should work.
Check what plug-ins are being used by the benchmark.jmx
Success Finally...
I have been able to launch it. Actually the issue was mostly with urls. I dont know why but 'host' and 'admin_path' variables work in funny ways with Magento. But i find a walk around by manually going through the 'html requests' and added the variable required. Now it is running
I think you're missing the Redis Data Set plugin also.
Please take a look at: https://jmeter-plugins.org/wiki/RedisDataSet/

Beanshell PreProcessor not not finding SampleResult

I am new to JMeter and am struggling to implement a Beanshell PreProcessor. I have this example code taken from a post on this site -
File querycsv = new File("xlocalTestData.csv");
if (!querycsv.exists()){
SampleResult.setSuccessful(false);
SampleResult.setRespnseMessage("Failed to find CSV file");
SampleResult.setData("Unable to locate CSV file under path: " + querycsv.getPath(),"UTF-8");
IsSuccess = false;
SampleResult.setStopTestNow(true);
Digging around on the internet I found this import statement -
import org.apache.jmeter.samplers.SampleResult;
But I am getting this error when passing a corrupt file name to test for a fail if the csv file is missing -
2014/03/03 13:11:11 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2014/03/03 13:11:11 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2014/03/03 13:11:11 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*)
2014/03/03 13:11:11 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Report Service Group 1
2014/03/03 13:11:11 INFO - jmeter.engine.StandardJMeterEngine: Starting 5 threads for group Report Service Group 1.
2014/03/03 13:11:11 INFO - jmeter.engine.StandardJMeterEngine: Thread will start next loop on error
2014/03/03 13:11:11 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 5 ramp-up 5 perThread 1000.0 delayedStart=true
2014/03/03 13:11:11 INFO - jmeter.threads.ThreadGroup: Started thread group number 1
2014/03/03 13:11:11 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2014/03/03 13:11:11 INFO - jmeter.threads.JMeterThread: Thread started: Report Service Group 1 1-1
2014/03/03 13:11:11 INFO - jmeter.services.FileServer: Stored: /home/brad/JMeter/ReportService/localTestData.csv Alias: /home/brad/JMeter/ReportService/localTestData.csv#1567545803
2014/03/03 13:11:11 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:11 WARN - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:11 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:11 WARN - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:11 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:11 WARN - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:11 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:11 WARN - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:12 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:12 WARN - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:12 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:12 WARN - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.apache.jmeter.samplers.SampleResult; File querycsv = new File("xloca . . . '' : Cannot reach instance method: setSuccessful( boolean ) from static context: org.apache.jmeter.samplers.SampleResult
2014/03/03 13:11:12 INFO - jmeter.threads.JMeterThread: Thread started: Report Service Group 1 1-2
Not being a Java programmer I am guessing that I don't have my include path set up? Is anyone able to point me toward a resolution?
I am running this on a Centos 6 desktop running Apache JMeter (2.11 r1554548)
Any help appreciated
Thanks
Brad
You need to use Beanshell Sampler, not Beanshell Pre Processor.
SampleResult is a pre-defined variable which is available for Beanshell Sampler only, neither pre nor post processors don't have access to it.
See How to use BeanShell guide for more details.

Resources