Class DslTestPlan

    • Field Detail

      • serializeThreadGroups

        protected boolean serializeThreadGroups
      • tearDownOnlyAfterMainThreadsDone

        protected boolean tearDownOnlyAfterMainThreadsDone
    • Method Detail

      • sequentialThreadGroups

        public DslTestPlan sequentialThreadGroups()
        Specifies to run thread groups one after the other, instead of running them in parallel.
        Returns:
        this instance for fluent API usage.
        Since:
        0.40
      • sequentialThreadGroups

        public DslTestPlan sequentialThreadGroups​(boolean enable)
        Specifies to run thread groups one after the other, instead of running them in parallel.

        Same as sequentialThreadGroups() but allowing to enable/disable the setting during runtime.

        Parameters:
        enable - specifies to run thread groups one after the other when set to true, or in parallel when false. By default, is set to false.
        Returns:
        the test plan for further configuration or usage.
        Since:
        0.65
      • tearDownOnlyAfterMainThreadsDone

        public DslTestPlan tearDownOnlyAfterMainThreadsDone()
        Allows running tear down thread groups only after main thread groups ends cleanly (due to iterations or time limit).

        By default, JMeter automatically executes tear down thread groups when a test plan stops due to unscheduled event like sample error when stop test is configured in thread group, invocation of `ctx.getEngine().askThreadsToStop()` in jsr223 element, etc. This method allows to disable such behavior not running teardown thread groups in such cases, which might be helpful if teardown thread group has only to run on clean test plan completion.

        Returns:
        the test plan for further configuration or usage.
        Since:
        0.40
      • tearDownOnlyAfterMainThreadsDone

        public DslTestPlan tearDownOnlyAfterMainThreadsDone​(boolean enabled)
        Allows running tear down thread groups only after main thread groups ends cleanly (due to iterations or time limit).

        By default, JMeter automatically executes tear down thread groups when a test plan stops due to unscheduled event like sample error when stop test is configured in thread group, invocation of `ctx.getEngine().askThreadsToStop()` in jsr223 element, etc. This method allows to disable such behavior not running teardown thread groups in such cases, which might be helpful if teardown thread group has only to run on clean test plan completion.

        Returns:
        this instance for fluent API usage.
        Since:
        0.65
      • showInGui

        public void showInGui()
        Description copied from interface: DslTestElement
        Shows the test element in it's defined GUI in a popup window. This might be handy to visualize the element as it looks in JMeter GUI.
        Specified by:
        showInGui in interface DslTestElement
        Overrides:
        showInGui in class BaseTestElement
      • showTimeline

        public void showTimeline()
        For each thread group shows a graph with a timeline of planned load (threads or rps) to be generated.

        Graphs will be displayed in a popup window.

        This method eases test plan design when working with complex thread group profiles (several stages with ramps and holds).

        Since:
        1.28
      • saveAsJmx

        public void saveAsJmx​(String filePath)
                       throws IOException
        Saves the given test plan as JMX, which allows it to be loaded in JMeter GUI.
        Parameters:
        filePath - specifies where to store the JMX of the test plan.
        Throws:
        IOException - when there is a problem saving to the file.
      • fromJmx

        public static DslTestPlan fromJmx​(String filePath)
                                   throws IOException
        Loads a test plan from the given JMX to be able to run it in embedded engine.
        Parameters:
        filePath - specifies the path where the JMX file is located.
        Returns:
        loaded test plan.
        Throws:
        IOException - when there is a problem loading to the file.
        Since:
        0.3
      • children

        public DslTestPlan children​(DslTestPlan.TestPlanChild... children)
        Allows adding additional children elements to a test plan.

        This might be helpful for adding elements to a test plan loaded from a JMX file (like adding htmlReport, resultsTreeVisualizer or dashboard) or if you want to create a test plan and then incrementally adding children to it.

        Overrides:
        children in class TestElementContainer<DslTestPlan,​DslTestPlan.TestPlanChild>
        Parameters:
        children - elements to add to the test plan.
        Returns:
        the test plan for further usage (run, show, etc).
        Since:
        0.56