All Downloads are FREE. Search and download functionalities are using the official Maven repository.

us.abstracta.jmeter.javadsl.http.DslCookieManager Maven / Gradle / Ivy

Go to download

Simple API to run JMeter performance tests in an VCS and programmers friendly way.

There is a newer version: 028
Show newest version
package us.abstracta.jmeter.javadsl.http;

import java.lang.reflect.Method;
import java.util.List;
import org.apache.jmeter.protocol.http.control.CookieManager;
import org.apache.jmeter.protocol.http.gui.CookiePanel;
import org.apache.jmeter.testelement.TestElement;

/**
 * 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 */ public class DslCookieManager extends AutoEnabledHttpConfigElement { public DslCookieManager() { super("HTTP Cookie Manager", CookiePanel.class); } /** * disables HTTP cookies handling for the test plan. * * @return the DslCookieManager to allow fluent API usage. */ public DslCookieManager disable() { enabled = false; return this; } @Override protected TestElement buildTestElement() { CookieManager ret = new CookieManager(); ret.setClearEachIteration(true); return ret; } public static class CodeBuilder extends AutoEnabledHttpConfigElement.CodeBuilder { public CodeBuilder(List builderMethods) { super(CookieManager.class, builderMethods); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy