0
votes

We are using TestNG framework to run JMeter script. Our Jmeter script includes few include controllers. When we execute using JMeter UI, the script gets executed successfully. But when script is executed using TestNG frame work either it throws error like path not found (for relative coded path) or include controller step is skipped (for Hard coded path)

Tried with Hard coded path as well as relative path to include the other test fragment

Relative Path for JMX file in include controller: "../../../lib/SM_TestFragments/XML/clearDBTables.jmx"

Absolute Path for JMX file in include controller: "/home/test/REMS_CI_Test/AutomationHome/lib/SM_TestFragments/XML/clearDBTables.jmx"

When include controller have "../../../lib/SM_TestFragments/XML/clearDBTables.jmx" path, it throws error as:

09:27:19.603 [StandardJMeterEngine] ERROR org.apache.jmeter.control.IncludeController - Include Controller 'Include Controller' can't load '../../../lib/SM_TestFragments/XML/clearDBTables.jmx' - see log for details 09:27:19.623 [StandardJMeterEngine] ERROR org.apache.jmeter.util.JMeterUtils - Including file "../../../lib/SM_TestFragments/XML/clearDBTables.jmx" failed for Include Controller "Include Controller", unexpected error - see log for details Including file "../../../lib/SM_TestFragments/XML/clearDBTables.jmx" failed for Include Controller "Include Controller", unexpected error - see log for details

When include controller have "/home/test/REMS_CI_Test/AutomationHome/lib/SM_TestFragments/XML/clearDBTables.jmx" path, There is no entry in log. The step is skipped.

1

1 Answers

0
votes

Consider checking jmeter.log file, it should contain more information regarding what went wrong.

One of possible reasons I can think of is that the .jmx script you're referencing using hte Include Controller has one or more JMeter Plugins and when you run the test using TestNG the plugin(s) is(are) not in Java Classpath

If you don't have jmeter.log file generated as the result of your test run consider setting log4j.configurationFile property pointing to the log4j2.xml file location