Package us.abstracta.jmeter.javadsl.http
Class DslCookieManager
- java.lang.Object
-
- us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
-
- us.abstracta.jmeter.javadsl.core.configs.BaseConfigElement
-
- us.abstracta.jmeter.javadsl.http.AutoEnabledHttpConfigElement
-
- us.abstracta.jmeter.javadsl.http.DslCookieManager
-
- All Implemented Interfaces:
DslConfig,DslTestElement,DslTestPlan.TestPlanChild,BaseSampler.SamplerChild,MultiLevelTestElement,BaseThreadGroup.ThreadGroupChild
public class DslCookieManager extends AutoEnabledHttpConfigElement
Allows configuring cookies settings used by HTTP samplers.This element can only be added as child of test plan, and currently allows only to disable HTTP cookies handling which is enabled by default (emulating browser behavior).
This element has to be added before any http sampler to be considered, and if you add multiple instances of cookie manager to a test plan, only the first one will be considered.
- Since:
- 0.17
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDslCookieManager.CodeBuilderstatic classDslCookieManager.CookiePolicy
-
Field Summary
Fields Modifier and Type Field Description protected booleanclearEachIterationprotected DslCookieManager.CookiePolicycookiePolicy-
Fields inherited from class us.abstracta.jmeter.javadsl.http.AutoEnabledHttpConfigElement
enabled
-
Fields inherited from class us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
guiClass, name
-
-
Constructor Summary
Constructors Constructor Description DslCookieManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.jmeter.testelement.TestElementbuildTestElement()DslCookieManagerclearCookiesBetweenIterations(boolean clear)Allows to enable or disable clearing cookies between thread group iterations.DslCookieManagercookiePolicy(DslCookieManager.CookiePolicy policy)Used to set the required cookie policy used to manage cookies.DslCookieManagerdisable()Disables HTTP cookies handling for the test plan.-
Methods inherited from class us.abstracta.jmeter.javadsl.http.AutoEnabledHttpConfigElement
buildEndListener, buildTreeUnder, getOrCreateContextEntry, registerDependency
-
Methods inherited from class us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
buildConfiguredTestElement, buildTestElementGui, configureTestElement, durationToSeconds, loadBeanProperties, showAndWaitFrameWith, showFrameWith, showInGui, showTestElementGui
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface us.abstracta.jmeter.javadsl.core.DslTestElement
showInGui
-
-
-
-
Field Detail
-
cookiePolicy
protected DslCookieManager.CookiePolicy cookiePolicy
-
clearEachIteration
protected boolean clearEachIteration
-
-
Method Detail
-
disable
public DslCookieManager disable()
Disables HTTP cookies handling for the test plan.- Returns:
- the DslCookieManager to allow fluent API usage.
-
clearCookiesBetweenIterations
public DslCookieManager clearCookiesBetweenIterations(boolean clear)
Allows to enable or disable clearing cookies between thread group iterations.Cookies are cleared each iteration by default. If this is not desirable, for instance if logging in once and then iterating through actions multiple times, use this to set to false.
- Parameters:
clear- boolean to set clearing of cookies. By default, it is set to true.- Returns:
- the cookie manager for further configuration or usage.
- Since:
- 1.6
-
cookiePolicy
public DslCookieManager cookiePolicy(DslCookieManager.CookiePolicy policy)
Used to set the required cookie policy used to manage cookies.You might need to change the 'standard' cookie policy if the application under test only supports a specific cookie implementation.
- Parameters:
policy- specifies the particular cookie policy to use. By default, it is set to standard cookie policy.- Returns:
- the cookie manager for further configuration or usage.
- Since:
- 1.6
- See Also:
DslCookieManager.CookiePolicy
-
buildTestElement
protected org.apache.jmeter.testelement.TestElement buildTestElement()
- Specified by:
buildTestElementin classBaseTestElement
-
-